.items()
딕셔너리.items()는 해당 딕셔너리의 키와 값을 튜플 형식으로 저장해준다.
>>> users = {'gunwoo':'gw', 'harry':'hyhl'}
>>> for user, id in users.items():
print(user, id)
'gunwoo' 'gw'
'harry' 'hyhl'
위의 예시에서,
users.items()는 [("gunwoo", "gw"), ("harry", "hyhl")]의 값을 갖게 된다.