How to get the ASCII value of a character in Python
Function ord() is used to get int ASCII value of any character in Python.
>>> ord('a')
97
To get back the character from any given int function chr() is used.
>>> chr(97)
'a'
>>> chr(ord('a') + 3)
'd'
>>>
If you are using UTF-8 charcters, you need to pass it a unicode otherwise, it will throw a TypeError error.
>>> ord(u'あ')
12354