Full name
chr
Library
Built-in
Syntax
chr(n)
Description
The chr function returns the character whose Unicode code n is passed as an argument. The valid range for n is 0 to 1,114,111 (0x10FFFF in base 16). If the argument is outside this range, the function returns an error of type ValueError .
This function is the inverse of the ord function.
Parameters
- n : Unicode code whose representation is to be obtained.
Result
The chr function returns a string.
Examples
The characters corresponding to the exclamation point and the lowercase Greek letter lambda are shown below: