Function Details: chr

Description


Returns a string of one character whose Unicode code point is the integer i.


Extended Description


The chr() function returns a string representing a character whose Unicode code point is the integer i. This function is the inverse of ord(). The valid range for the argument is from 0 to 1,114,111 (0x10FFFF in hexadecimal).


Exceptions


  • ValueError: If the integer is outside the valid Unicode code point range (0 to 1,114,111)

Read More about chr from Python Documentation

Function Signature


chr(i: int) -> str

Module: builtins

Parameters


i: An integer representing a valid Unicode code point.


Parameter List


  • i: int

Return


Returns a string of length 1, containing the character corresponding to the specified Unicode code point.


Return Type


str

Output

Explanation

This example shows chr() used with ASCII and Unicode code points.