Skip to content
Home » Python Program to Print ASCII Table

Python Program to Print ASCII Table

Learn about Python Program to Print ASCII Table in the below code example. Also, refer to the comments in the code snippet to get a detailed view about what’s actually happening.

ASCII is an acronym that stands for American Standard Code for Information Interchange. It is a character encoding system that represents English characters with numbers ranging from 0 to 127. For example, the ASCII code for character A is 65, and the ASCII code for character Z is 90.

Python Program to Print ASCII Table

chr() method is used to print the ASCII value of the character.

Program:

# Python program to print ASCII table

# print ASCII characters from 0 to 255
for i in range(256):
    ch = chr(i)
    print('ASCII value of', i, 'is =', ch)

It prints the required ASCII table.

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Code : HCF using Euclidean Algorithm in Python