I want to get, given a character, its ASCII value.
For example, for the character a, I want to get 97, and vice versa.
4 Answers
>>> chr(97) 'a' >>> ord('a') 97 >>> ord('a') 97 >>> chr(97) 'a' 4ord and chr
2For long string you could use this.
''.join(map(str, map(ord, 'pantente')))