This is my code:
import string values = dict() user_entry=raw_input("Enter: ") for index, letter in enumerate(string.ascii_lowercase): values[letter] = index + 1 print values[user_entry]
I am trying to get a number for each letter from a word the user enters. For example, if the user enters "code" then I need to assign a number to c, o, d, and e. For c it would be 3, for o it would be 15, for d it would be 4, and for e it would be 5. I tried to separate them by using list so that I can split each letter to get a number for each letter but nothing seems to work. I need some help!!