Items


1 Python[ | ]

member = { 'ID' : 102, 'Name' : 'YONEZAWA Akinori', 'Address' : 'Naha, Okinawa' }
print( member.items() )
# Python 2
# [('Address', 'Naha, Okinawa'), ('ID', 102), ('Name', 'YONEZAWA Akinori')]
# Python 3
# dict_items([('Address', 'Naha, Okinawa'), ('ID', 102), ('Name', 'YONEZAWA Akinori')])
dict = {'a': 1, 'b': 2, 'c': 3}
print( dict.items() )
# dict_items([('a', 1), ('c', 3), ('b', 2)])
dict = {'a': 1, 'b': 2, 'c': 3}
for k, v in dict.items():
    print(k, v)
# a 1
# b 2
# c 3

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}