How to find ASCII value in Python
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
Subscribe
Login
Please login to comment
0 Discussion