
December 17th, 2012, 05:08 AM
|
 |
Contributing User
|
|
Join Date: Nov 2012
Location: Iran / France
|
|
Hi,
I'm not sure whether I understood your problem exactly, but what I understand is that you wish to map each letter into the numeric values defined for those corresponding letters in your code. For me that works like a dictionary
Code:
>>> dictionary = {'A':7, 'B':8, 'C':9}
>>> letter = raw_input('Enter letter: ')
Enter letter: A
>>>
>>> print (dictionary[letter])
7
>>>
Regards,
Dariyoosh
|