字典
# 字典
# 字典由键和值组成
dict1 = {'name':'Python', 'Date':2001}
dict2 = {12: 15, 3: '5'}
print("dict1['name']:",dict1['name'])
dict = {'Name': 'Phil', 'Age': 7, 'Class': 'First'}
print("dict['Name']: ", dict['Name'])
print("dict['Age']: ", dict['Age'])
dict['Age'] = 8 # 更新 Age
dict['School'] = "CCU" # 添加信息
print("dict['Age']: ", dict['Age'])
print("dict['School']: ", dict['School'])
字典需要键和值,键不可以重复,否则按照后来的定义取值
字典可以被更新和添加,也有函数可用