from functools import reduced = {'a':{'b':{'c':'value'}}}path = "a.b.c"val = reduce(lambda o, k: o[k], path.split("."), d)print(val)
Standard input is empty
value
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!