📜  向 Python 字典添加新元素 - Python 代码示例

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

代码示例2
d = {'a': 1, 'b': 2}
print(d)
d['a'] = 100  # existing key, so overwrite
d['c'] = 3  # new key, so add
d['d'] = 4
print(d)