Python dict Dictionaries update() Function dictionary dict2 Key / Value pair update to dict in .
dict.update(dict2)
Be careful : If you have the same key, it will be directly replaced with update Value ;
dict = {
'Name': 'Zara', 'Age': 7}
dict2 = {
'Sex': 'female'}
dict.update(dict2)
print(dict) # result {'Name': 'Zara', 'Age': 7, 'Sex': 'female'}
dict = {
'Name': 'Zara', 'Age': 7}
dict2 = {
'Age': 18, 'Sex': 'female'}
dict.update(dict2)
print(dict) # result {'Name': 'Zara', 'Age': 18, 'Sex': 'female'}