I have 3 different dictionaries in python like these
d1 = {'simple_key':'hello'}
d2 = {'k1':{'k2':'hello'}}
d3 = {'k1':[{'nest_key':['this is deep',['hello']]}]}
and I want to grab the word 'hello' from these dictionaries. But the problem I am facing is that I want to find a generic way to extract it. How can I do it?
dictionary[key1][key2]...[keyN]is a generic way to get to any element. Or do you simply want to check that there is "hello" somewhere as a value?if "hello" in json.dumps(d1)?