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


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(' ')


Updated on: 25-Feb-2020

508 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements