ASCII Value

ASCII (American Standard Code for Information Interchange) is the character encoding standard of electronic communication. ASCII codes represent text within computers, telecommunications equipment, and other devices. – Wikipedia

Logic

To find the ASCII value of a character we have to use the built-in ord() function that returns the Unicode Code Point for the given character.

Program

# Take a character from user
ch = input("Enter any character : ")

# Print the ASCII value
print("\nASCII value of " + ch + " is :", ord(ch))

Output

Enter any character : a
ASCII value of a is 97