Replacing a key value pair in dictionary which is also nested (Python) Say I have a dictionary like this: