Find ASCII Value of Character in Python

(Last Updated On: 25/11/2022)

Python Program to Find ASCII Value of Character

# Find ASCII Value of Character in python

# entered value will be converted string
char=str(input("Enter the character: "))

# ord() function to convert a character to an integer ASCII value
print("The ASCII value of '" + char + "' is", ord(char))

Output:

Enter the character: N
The ASCII value of 'N' is 78

Leave a Reply

Your email address will not be published. Required fields are marked *