update()批量写入批量更新字典,举个例子:
1 a = { 2 "name":"dlrb", 3 "age":25, 4 "height":168 5 } 6 b = { 7 "husband":"zzq", 8 "dear":521 9 } 10 a.update(b) 11 print(a)
输出结果:
{'dear': 521, 'age': 25, 'name': 'dlrb', 'husband': 'zzq', 'height': 168}
我们将字典b批量写入到字典a中