how to use python "get()" for keys deeper than first level of dictionary keys?
You can pass a default value as the second argument to dict.get()
, like this:
dict.get('keyB_1', {}).get('keyB_2', {}).get('keyB_3')
You can pass a default value as the second argument to dict.get()
, like this:
dict.get('keyB_1', {}).get('keyB_2', {}).get('keyB_3')