描述:以列表的形式返回由字典的键值对组成的元组
示例:
my_info = {
'name': 'xdw',
'age': 26,
'school': 'BJUT',
}
info_list = my_info.items()
print(info_list)
>>>dict_items([('name', 'xdw'), ('age', 26), ('school', 'BJUT')])
info_list = my_info.items()
print(info_list)
for key, value in my_info.items():
print(key, ': ', value)
>>>name : xdw
>>>age : 26
>>>school : BJUT