>>651
import functools
d={"a":{"b":{"c":{"d":111}}}}
ary=["a","b","c","d"]
print(functools.reduce(lambda d, k: d[k], ary, d))