Here we have provided a python source code that can find the ASCII value of the user entered character.
ASCII Code or value: ASCII stands for American Standard Code or Information Interchange, and it is used to represent 128 characters as numbers, which include special symbols too.
Prerequisite topics to create this program
- Python Input, Output
- python ord()
- Ask the user to enter a character.
- Use the ord() function to find the ASCII code of the character.
Python Program to Find ASCII Value of Character:
ch = input("Enter a Character: ") if len(ch)==0: print("The ASCII code of",ch,"is",ord(ch)) else: print("The ASCII code of",ch,"is",ord(ch))
Enter a Character: A The ASCII code of A is 65
Enter a Character: ! The ASCII code of ! is 33
People are also reading:
- WAP to find the average of list of numbers entered by the user
- WAP to calculate the Factorial of an Integer
- Perfect Number in C
- WAP to find the largest number amongst the numbers entered by the user
- WAP to find the divisors of a positive Integer
- WAP to Display Fibonacci Series
- WAP to swap two numbers
- C++ and Python Code to Find The Sum of Elements Above and Below The Main Diagonal of a Matrix
- C Program to Extract a Portion of String
- Python Examples