How to convert a single character to its integer value in Python?

PythonServer Side ProgrammingProgramming

Each character is associated with an ASCII value which is a unique number. It is obtained by ord() function.

>>> ord('A')
65
>>> ord('+')
43
>>> ord(' ')


raja
Updated on 25-Feb-2020 11:14:47

Advertisements