I am trying to convert the following list:
list = [\'A\',\'B\',\'C\']
To a dictionary like:
dict = {\'A\':0, \'B\':1, \'C\'
Use built-in functions dict and zip :
>>> lst = ['A','B','C'] >>> dict(zip(lst,range(len(lst))))