I want to merge two dictionaries into a new dictionary.
a = {'x': 1, 'y': 5}
b= {'y': 3, 'z': 4}
>>> c
{'x': 1, 'y': 3, 'z': 4}
Whenever a key y
is present in both dictionaries, only the value b[y]
should be kept.
I want to merge two dictionaries into a new dictionary.
a = {'x': 1, 'y': 5}
b= {'y': 3, 'z': 4}
>>> c
{'x': 1, 'y': 3, 'z': 4}
Whenever a key y
is present in both dictionaries, only the value b[y]
should be kept.