Python Program to Print ASCII Values

« Previous Program Next Program »

Print ASCII Values in Python

To print ASCII value of all characters in python, just follow the program given below. This python program will print all the character along with their ASCII values.

Python Programming Code to Print ASCII Values

Following python program will print all the 255 character along with their ASCII values:

# Python Program - Print ASCII Values
for i in range(1, 255):
    ch = chr(i);
    print(i, "=", ch);

Here are all the sample runs of above python program illustrating how to print ASCII values of all characters.

If you will run the above program, then all the characters you will see along with its number representing at left side as shown here in below demo output:

ascii values python

Here are some screenshot of the same program with run directly on python shell:

First Snapshot:

python print ascii values

Second Snapshot:

print ascii value of character

Third Snapshot:

print ascii values

Fourth Snapshot:

print all ascii values of characters in python

Fifth Snapshot:

list of all character with their ascii values

Sixth Snapshot:

python display ascii values

Seventh Snapshot:

python find ascii values of characters

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test