Contact: aviboots(AT)netvision.net.il
39,009 questions
50,723 answers
573 users
lst = ['python', 'c', 'c++', 'java'] dic = {lst[i]: i for i in range(0, len(lst), 1)} print(dic) ''' run: {'python': 0, 'c': 1, 'c++': 2, 'java': 3} '''