How to convert an integer to an ASCII value in Python?


ASCII character associated to an integer is obtained by chr() function. The argument for this function can be any number between 0 to 0xffff

>>> chr(0xaa)
'ª'
>>> chr(0xff)
'ÿ'
>>> chr(200)
'È'
>>> chr(122)
'z'


Updated on: 25-Feb-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements