I have an iterable of keys like ('a', 'b', 'c') that I want to correspond to an entry in a dictionary I am building. I am looking for a one-linerish way to build this dictionary from multiple tuples.
Input:
keys = ('a', 'b', 'c') value = 'bar' Output:
{'a': {'b': {'c': 'bar'}}} I have been trying things using defaultdict, but haven't really gotten the grasp of it. The one-liner requirement is pretty soft, but I was hoping to get a really small footprint for this.