How convert list to nested dictionary?

macm moura.mario at gmail.com
Thu Nov 4 14:48:28 EDT 2010


Hi Folks

How convert list to nested dictionary?

>>> l
['k1', 'k2', 'k3', 'k4', 'k5']
>>> result
{'k1': {'k2': {'k3': {'k4': {'k5': {}}}}}}

Regards

macm



More information about the Python-list mailing list