Python中的字典表示键(keys)和值(values)。、
例如:
student_grades = {'John': 'A','Mary': 'C', 'Rob': 'B'}# To check grade of John, we call
print(student_grades['John'])实例使用values方法:
dict = {'Sex': 'female', 'Age': 7, 'Name': 'Zara'}
print ("字典所有值为 : ", list(dict.values()))输出结果:
['female', 7, 'Zara']