[Python] 데이터 입력받기

Dana·2021년 3월 8일
0

Python

목록 보기
1/1

1.

# 한 줄의 문자열 입력받기
input()

# 정수형 데이터로 처리
int(input())

2.

# 공백을 기준으로 입력받기
a, b, c = map(int, input().split())

# 공백을 기준으로 입력받고 리스트에 저장
data = list(map(int, input().split()))

3.

# sys 라이브러리 이용 (문자열은 rstrip()을 붙여준다)
import sys
data = sys.stdin.readline().rstrip()
data = list(map(int, sys.stdin.readline().split()))

4.

# 여러 줄의 입력을 받고 리스트에 저장
arr = []
while(True):
	arr.append(sys.stdin.readline().rstrip())

0개의 댓글