Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。
语法
items()方法语法:
dict.items()
参数
- NA。
返回值
返回可遍历的(键, 值) 元组数组。
实例
以下实例展示了 items()函数的使用方法:
Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。
items()方法语法:
dict.items()
返回可遍历的(键, 值) 元组数组。
以下实例展示了 items()函数的使用方法:
class MetaCls(type): def __new__(cls, *args, **kwargs): print("in MetaCls") # return super(Meta