I have a variable length nested dictionary being read from an api response and I want to be able to read the value of a key that could be deeply nested.
For example:
responses = {'animal': {'name': 'lassy'}}
print(responses['animal']['name'])
However I do not know the length of the dictonary in the response, I could be asked to find the value of "foo.bar.foo.bar"
Is there a way to set up my code that no matter the length of the response I can access the needed value?