[TIL] Python #7 input 여러개 선언

김성진·2020년 7월 27일
0
post-thumbnail

x=[int(x) for x in input("Enter multiple values: ").split()]

input에 여러 값을 넣고 싶을때는 위와 같이 for문과 input을 함께 실행 해준다. 그리고 split()을 넣어 변수인 x가 여러개일 경우 분리시켜 표기 해준다.

profile
multi-national communicator with programming (back-end)

0개의 댓글