I'm making simple use case of my problem, here its is:
dic = {'a': 1, 'b': {'c': 2}}
Now i want to have a method which operates on this dictionary, fetch values based on the key.
def get_value(dic, key):
return dic[key]
At different places this generic method will be called to fetch the values.
get_value(dic, 'a')
will work.
Is it be possible to get the value 2 (dic['b']['c'])
in more generic way.