Python Program to ASCII Value of Character

Python program to print ascii value of character; Through this tutorial, i am going to show you how to print character using ASCII value in Python.

Python Program to Print ASCII Value of Character

  • Python program to print ASCII value of a character
  • How to print character using ASCII value in python

Python program to print ASCII value of a character

# Program to find the ASCII value of the given character
chr = input("Please Enter Character :- ")
convert = ord(chr)
print("The ASCII value of '" + chr + "' is", convert)

Output:

Please Enter Character :- k
k
The ASCII value of 'k' is 107

How to print character using ASCII value in python

# Program to find the Character from ASCII value
test = input("Please Enter ASCII Value :- ")
convertToInt = int(test)
convertToAscii = chr(convertToInt)
print("The ASCII value of '" + test + "' is", convertToAscii)

Output:

Please Enter ASCII Value :- 65                                                                                                
The ASCII value of '65' is A  

Recommended Python Tutorials

Recommended:-Python Map() Method

Leave a Comment