Python items()---字典属性
背景知识点:
Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。

使用方法:
字典名.items()
示例:
dicts={'short':2,'int':4,'long':8,'long long':8}
for key,value in dicts.items():
print(f'The size of {key} is {value} bytes.')
Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。

字典名.items()
dicts={'short':2,'int':4,'long':8,'long long':8}
for key,value in dicts.items():
print(f'The size of {key} is {value} bytes.')