I want to use the items in a list as dictionary keys to find a value in nested dictionaries.
For example, given the following list:
keys = ['first', 'second', 'third']
I want to do:
result = dictionary[keys[0]][keys[1]][keys[2]]
Which would be the equivalent of:
result = dictionary['first']['second']['third']
But I don't know how many items will be in the keys list beforehand (except that it will always have at least 1).
addict.Dict- that's probably the easiest way. Otherwise of course you can iterate with.get()