'''字典的遍历''' scores={'张三':100,'李四':98,'王五':45} for item in scores: print(item,scores[item],scores.get(item)) #获取分别是键 和 值
E:\PycharmProjects\pythonProject\venv\Scripts\python.exe E:/PycharmProjects/pythonProject/demon1/demo7.py 张三 100 100 李四 98 98 王五 45 45 进程已结束,退出代码0