Python/gloss python change dictionary item
来自菜鸟教程
<languages />
Python在字典中更改值
更改字典中的值
您可以通过参考特定项的键名来更改其值:
例
将“年份”更改为2018:
thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964 } thisdict["year"] = 2018
<languages />
您可以通过参考特定项的键名来更改其值:
将“年份”更改为2018:
thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964 } thisdict["year"] = 2018