Python 3 教程
Python3 字典
Python 字典 update() 函數(shù)把字典參數(shù) dict2 的 key/value(鍵/值) 對更新到字典 dict 里。
update() 方法語法:
dict.update(dict2)
該方法沒有任何返回值。
以下實例展示了 update()函數(shù)的使用方法:
以上實例輸出結果為:
更新字典 dict : {'Name': 'Runoob', 'Age': 7, 'Sex': 'female'}