- zip
- dict
Create index-to-value mapping in a dictionary based on a list of values
examples/functional/index_to_value.py
planned_order = ('b', 'c', 'd', 'a') plan = dict(zip(range(len(planned_order)), planned_order)) print(plan)
{0: 'b', 1: 'c', 2: 'd', 3: 'a'}