Python chr() function
Return the character for a Unicode code number.
Syntax
chr(i)
The opposite of ord. Every character, in every alphabet and including emoji, has a number.
Parameters
| i | a Unicode code point |
Return value
a one-character string
Example
Code
print(chr(65), chr(97), chr(8364)) print([chr(c) for c in range(ord("a"), ord("f"))])
Output
A a € ['a', 'b', 'c', 'd', 'e']
Related
Learn it step by step in the free lesson Strings, with exercises that check your answers.