dict1 ={'Alice': '123', 'Beth': '456', 'Cecil': 'abc'} print(dict1['Alice']) #输出123 dict1['new'] = 'Hello' #增加新的键值对 dict1['Alice'] = '1234' #修改已有键值对 dict2 = {'abc': 123, 456: 78.9} print(dict2[456]) #输出78.9