Built-in Functions and Types

chr()

Turn a Unicode code point into a one-code-point Python string. This operation does not encode bytes or check that the character is printable. The numeric range is 0 through 0x10FFFF inclusive, including surrogate code points; out-of-range integers raise ValueError. Use ord() to reverse the conversion.

Formal Syntax & Structure

python syntaxpython
chr(i, /)

Parameters & Attributes

NameTypeDescription
iint or object supporting __index__Unicode code-point number.

Return Value

str

A string of length one.

Working Example

Example Snippetpython
print(chr(0x2605))print(chr(0x0645))
Python Reference