📜  如何在 python\ 中向字典添加键和值 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:11.384000             🧑  作者: Mango

代码示例1
diction = {'key':'value'}#Adding a dictionary called diction.
print(diction)
diction['newkey']='newvalue'#Adding the newkey key to diction with its value.
print(diction)
#output: {'key':'value','newkey':'newvalue'}