Python | Program to Find ASCII Value of Character

Every hardware device does not understand any upper level code. For example x = 10 in Python means x is a variable having value 10. But internally hardware doesn’t understand 10 or x, rather it understands only ones/zeros(10000010010). That’s why American Standards Association has defined some rules which state that any character would be assigned a specific number which internally will translate to zeros/ones. These rules are known as ASCII – American Standard Code For Information Interchange. For example – Character c is equivalent to 112 as per ASCII.
So c => 112(As Per ASCII) =>Some Sequence of ones/zeros(internally)

Python Code for Finding ASCII Value of Character

# Finding ASCII value of Character using Python Code

some_character = "d"

# Printing out ASCII value of some_character

print("ASCII value of character is =>", ord(some_character))

Output of Above Code

ASCII value of character is => 100

Gagan

Hi, there I'm founder of ComputerScienceHub(Started this to bring useful Computer Science information just at one place). Personally I've been doing JavaScript, Python development since 2015(Been long) - Worked upon couple of Web Development Projects, Did some Data Science stuff using Python. Nowadays primarily I work as Freelance JavaScript Developer(Web Developer) and on side-by-side managing team of Computer Science specialists at ComputerScienceHub.io

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts