def main(): print 'This program returns the ASCII code of the key pressed.' key=1 while key!=10: key=raw_input('Please, enter a character:') key_ord=ord(key) print 'ASCII code of %c is %d'%(key,key_ord) main()