Python example for ASCII Value of a Single Character

ch = input("Enter any character: ")
print("The ASCII value of char " + ch + " is: ",ord(ch))

OUTPUT:

Enter any character: D
The ASCII value of char D is:  68

Leave a Comment