I am trying to find a better way to implement this:
d = {"a": {"b": {"c": 4}}}
l = ["a", "b", "c"]
for x in l:
d = d[x]
print (d) # 4
I am learning functional programming so I am just trying random example that come to my head :)
See Question&Answers more detail:os