python convert list to dict with index

>>> lst = ['A','B','C']
>>> {k: v for v, k in enumerate(lst)}
{'A': 0, 'C': 2, 'B': 1}

Here is what the above code is Doing:
1. We create a list of keys and values.
2. We use a dictionary comprehension to create a dictionary from the list.
3. We print the dictionary to see the results.

The output from the code above is:

{‘A’: 0, ‘C’: 2, ‘B’: 1}