Python 术语表
向字典中添加项目是通过使用新的索引键并向其分配值来完成的:
thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964 } thisdict["color"] = "red" print(thisdict)
亲自试一试