From JSON data I obtain a complicated dictionary strucutre. Say I want to obtain values such as temperature, which I can access by specifying a number of keys.
},
"t": {
"v": -4.1}
temp = float(json_object['data']['iaqi']['t']['v'])
Sometimes this data might not have say "t" and I get a KeyError. So I want to use the dictionary .get() method in order to avoid this, but it only takes 2 arguments. Is there a way I can use this method using 4 keys? Or is there an alternative approach to the KeyError problem I could try?