Python-字典元素的遍历
for item in scores:
print(item)
1 scores = {'张三': 100, '李四': 98, '王五': 45} 2 # 字典元素的遍历 3 for item in scores: 4 print(item, scores[item], scores.get(item))
for item in scores:
print(item)
1 scores = {'张三': 100, '李四': 98, '王五': 45} 2 # 字典元素的遍历 3 for item in scores: 4 print(item, scores[item], scores.get(item))