tel={'jack':101,'tom':102} tel['sunny']=103 print(tel) print(tel['tom']) del tel['tom'] print(tel) print(tel.keys())
运行结果:
{'jack': 101, 'tom': 102, 'sunny': 103} 102 {'jack': 101, 'sunny': 103} dict_keys(['jack', 'sunny'])
tel={'jack':101,'tom':102} tel['sunny']=103 print(tel) print(tel['tom']) del tel['tom'] print(tel) print(tel.keys())
运行结果:
{'jack': 101, 'tom': 102, 'sunny': 103} 102 {'jack': 101, 'sunny': 103} dict_keys(['jack', 'sunny'])