Suppose I have a nested dict
in python like:
a[1][2] = 4
a[1][3][3] = 5
And I have another straightforward non-nested dict like so:
{
1 : "Kansas City",
2 : "Toledo",
3 : "Houston",
4 : "Champaign",
5 : "Seattle"
}
How do I replace all the keys and values in the first dict that match the keys in the second dict with the second dict's corresponding values so that the output looks like:
a["Kansas City"]["Toledo"] = "Champaign"
a["Kansas City"]["Houston"]["Houston"] = "Seattle