定义和用法
update() 方法向字典插入指定的项目。
这个指定项目可以是字典或可迭代对象。
实例
例子 1
向字典插入项目:
car = { "brand": "Porsche", "model": "911", "year": 1963 } car.update({"color": "White"}) print(car)
运行实例 »
语法
dictionary.update(iterable)
参数
返回:Python 字典