I have two dictionaries:
dict1 = {'cm': {'fill': {'user': {'registration': {'flag': 'f'}}}}}
dict2 = {'cm': {'fill': {'user': {'url': 'www.example.com'}}}}
The output I want:
dict3 = {'cm': {'fill': {'user':{'registration': {'flag': 'f'}}, {'url': 'www.example.com'}}}
Here is what I have tried so far:
dict3 = {**dict1, **dict2} # This does not work. It only gives me a `dict1`.
The problem is that dict1
and dict2
can have many embedded keys.
Any idea how to do this?