리스트 내포(List comprehension)

# '1 2 3 4'를 입력받아 [1,2,3,4] 리스트 생성

[int(i) for i in input().split()] # == list(int(i) for i in input().split())

# tuple version

tuple(int(i) for i in input().split())


참고: 

https://wikidocs.net/22

https://stackoverflow.com/questions/16940293/why-is-there-no-tuple-comprehension-in-python



WRITTEN BY
hojongs
블로그 옮겼습니다 https://hojongs.github.io/