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