Given a character, and we have to find its ASCII code.
ASCII value of character in Python
In python, to get an ASCII code of a character, we use ord() function. ord() accepts a character and returns the ASCII value of it.
Syntax:
ord(character);
Example:
Input:
char_var = 'A'
Function call:
ord(char_var)
Output:
65
Python code to find ASCII value of a character
Output
need an explanation for this answer? contact us directly to get an explanation for this answer