I'm looking for a way to update a nested dict dict1
dic1 = {'key1': {'key2': {'key3': {'key4': {'key51': {'key511': 'val511', 'key512': 'val512'}}, 'key52': {'key521': {'key5211': 'val5211', 'key5212': 'val5212'}}}}}}
I want to replace the element in dic1: {'key51': {'key511': 'val511', 'key512': 'val512'}} to 'val4'
So I can get a new dictionary as the following:
dic2 = {'key1': {'key2': {'key3': {'key4':...