Python 更改字典中的值
更改字典中的值
您可以通过引用其键名来更改特定项的值
示例
将 "year" 更改为 2018
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict["year"] = 2018
亲自试一试 »
您可以通过引用其键名来更改特定项的值
将 "year" 更改为 2018
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict["year"] = 2018
亲自试一试 »
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]
If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]