How to get the ASCII value of character in Python

1 Answer

0 votes
ch = 'a'

print("The ASCII value of '" + ch + "' =", ord(ch))
 
 
'''
run:
 
The ASCII value of 'a' = 97
 
'''

 



answered May 30, 2017 by avibootz
...