How to find ASCII value in Python
![How to find ASCII value in Python](https://pythonpoint.net/wp-content/uploads/2020/11/How-to-find-ASCII-value-in-Python-1024x576.jpg)
ASCII (American Standard Code for Information Interchange) is a character encoding standard for text files. Each symbol in the character set can be represented by a Decimal value ranging from 0 to 127, as well as equivalent Hexadecimal and Octal values.
To find the ASCII value of a character, we can use the built-in function ord() function, which accepts a char (string of length 1) as argument and returns the unicode code point for that character.
inp = input("Enter a character: ") print("ASCII is ", ord(inp))
Output:
Enter a character: 2 ASCII is 50
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-2020-11-16-165017.jpg)
Subscribe
Login
Please login to comment
0 Discussion