Welcome folks today in this post we will be printing the ascii value
of character using ord()
method in python. All the full source code of the application is shown below.
Get Started
In order to get started we need to make an app.py
file and copy paste the following code
app.py
1 2 3 4 5 6 7 8 9 |
# Python program to print # ASCII Value of Character # In c we can assign different # characters of which we want ASCII value c = 'g' # print the ASCII value of assigned character in c print("The ASCII value of '" + c + "' is", ord(c)) |
Now if you execute the python script by typing the below command as shown below
python app.py