Basic Programs


Python program to get a character from the ASCII value


In this example shows, how to get character from the ACSII value using chr() method in python.

  • ASCII stands for American Standard Code for Information Interchange.
  • The built-in function chr() returns the character from a given ASCII value.
example.py
c=65
print("The Character of "+c+" is ",ord(c))

c=97
print("The ASCII value of "+c+" is ",ord(c))

c=49
print("The ASCII value of "+c+" is ",ord(c))

c=64
print("The ASCII value of "+c+" is ",ord(c))

Output

The Character of ASCII value 65 is  A
The Character of ASCII value 97 is  a
The Character of ASCII value 49 is  1
The Character of ASCII value 64 is  @

Prev Next