items()函数以列表返回可遍历的键、值
用法:dict.items()
dict={"software":16000,"electric":5000}
for key,value in dict.items():
print(key,value)
当字典名称非dict时
class={"chinese":10,"english":20} ####此处有错误,取名不规范,class不能作为字典名
class2 = {"chinese":10,"english":20}
for key,value in dict.items(class2):
print(key,value)
注:感谢评论区的朋友提出问题