# How can I convert a character to a integer in Python, and viceversa?

## The Question :

345 people think this question is useful

I want to get, given a character, its ASCII value.

For example, for the character a, I want to get 97, and vice versa.

577 people think this answer is useful
>>> chr(97)
'a'
>>> ord('a')
97



68 people think this answer is useful
>>> ord('a')
97
>>> chr(97)
'a'