字典 items() 方法
描述
Python 字典 items() 方法以列表返回可遍历的(键, 值) 元组数组。
语法
items()方法语法:
dict.items()
# 无参数
返回值
返回可遍历的(键, 值) 元组数组。
实例
dict = {'Name': ['zhu', 'hong', 'hui'], 'Age': [7, 3, 8]}
dict.items()
dict_items([('Name', ['zhu', 'hong', 'hui']), ('Age', [7, 3, 8])])