作者:非常名花有主 | 来源:互联网 | 2023-05-18 09:57
dict.update(dict_2)
将dict_2中的键值对添加(更新)到dict中.
dict = {'name':'wuq','gender':'female','age':'16'}
dict_2 = {'girl':'beautiful'}
dict.update(dict_2)
dict = {'name':'wuq','gender':'female','age':'16','girl':'beautiful'}