I have a python dict, and some (but not all) of its values are also dicts.
For example:
d = {'a' : 1,
'b' : {'c' : 3, 'd' : 'target_value'}
}
What would be the best way to pass in keys to reach any target value? Something like retrieve(d, (key, nested_key, ...)) where retrieve(d, ('b','d')) would return target value.
retrieve(d, ('b', 'd'))should returntarget_value