In this tutorial, we will learn how to print the ASCII value of a character
Explanation ✏
- First, We need to take input from the user
- Now with the help of the ord() function, we will find the ASCII value of the input value
- Finally, print the output
Code 👩💻
def covASCII():
inputChar = input("Enter a character: ")
ordChar = ord(inputChar)
print(ordChar)
covASCII()
Output :
Enter a character: A
The ASCII value of A is 65