使用场景:涉及两个字典的合并时
实例:
>>> D1 = {'one':1, 'two':2}
>>> D2 = {'three':3}
>>> D1.update(D2)
>>> D1
{'one': 1, 'two': 2, 'three': 3}
>>> D1 = {'one':1, 'two':2}
>>> D1.update(three=3)
>>> D1
{'one': 1, 'two': 2, 'three': 3}
原文:https://www.cnblogs.com/w-j-c/p/10776618.html