본문 바로가기
컴알못/Python

[Python] 오류 코드 - TypeError: cannot unpack non-iterable int object

by 난프로 2022. 2. 18.
1
2
a, b, c, d,  e = 100
print (a, b, c, d, e)
cs

 line 1, in <module>
    a, b, c, d, e = 100
TypeError: cannot unpack non-iterable int object


: 여러 변수에 동일한 값을 할당할 때 변수 구분을 "," 로 하여 발생한 오류

: "," 대신 "=" 또는 한줄에 하나의 변수 할당하면 해결됨.

 

1
2
= b = c = d = e = 100
print (a, b, c, d, e)
cs

100 100 100 100 100

'컴알못 > Python' 카테고리의 다른 글

[Python] 오류 코드 - TypeError: 'int' object is not callable  (0) 2022.03.31