Need you help to get an idea how to update dictionary value that represented as dictinary.
Here are two dictionaries: d1 = {'x': {'y': 5}} d2 = {'x': {'z': 6}}
Assume d1 + d2, then dictionary = {'x': {'y': 5, 'z': 6}}
Thank you.
Need you help to get an idea how to update dictionary value that represented as dictinary.
Here are two dictionaries: d1 = {'x': {'y': 5}} d2 = {'x': {'z': 6}}
Assume d1 + d2, then dictionary = {'x': {'y': 5, 'z': 6}}
Thank you.
It's rather simple...
d1['x'].update(d2['x'])
or for all keys:
[d1[k].update(d2[k]) for k in d1]