builtin_function_or_method object is not iterable

YU NA Joe·2022년 2월 7일
0

Because while using items function of dictionary programmer missed to write parenthesis, ()

user = {
"name": "Saurabh Gupta",
"age": 35,
"city": "Noida"
}
for key, value in user.items:
print(key)

     # TypeError: 'builtin_function_or_method' object is not iterable

items를 사용할때 ()를 안 했다.

for key, value in user.items():
print(key)

0개의 댓글