I am trying to convert the following list:
l = ['A', 'B', 'C']
To a dictionary like:
d = {'A': 0, 'B': 1, 'C': 2}
I have tried answers from other posts but none is working for me. I have the following code for now:
d = {l[i]: i for i in range(len(l))}
Which gives me this error:
unhashable type: 'list'