How to convert an integer to a unicode character in Python?


Python library's chr() function converts Unicode character associated to any integer which is between 0 an 0x10ffff.

>>> chr(36)
'$'
>>> chr(97)
'a'
>>> chr(81)
'Q'

Updated on: 09-Sep-2023

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements