python中增加字典的键值对(项)、修改键值对的值
1、
>>> a = dict(a = 111, b = 222, c = 333, d = 444)
>>> a
{'a': 111, 'b': 222, 'c': 333, 'd': 444}
>>> a["e"] = 555 ## 增加项
>>> a
{'a': 111, 'b': 222, 'c': 333, 'd': 444, 'e': 555}
>>> a["b"] = 888 ## 修改键值对的值
>>> a
{'a': 111, 'b': 888, 'c': 333, 'd': 444, 'e': 555}