Python chr()

christian.dinh's avatar
Published Jun 19, 2021Updated Sep 3, 2021
Contribute to Docs

Returns Unicode characters represented by integers ranging between 0 and 1,114,111.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
    • With Certificate
    • Beginner Friendly.
      24 hours

Syntax

chr(integer)

Example 1

Use chr() to return the Unicode character represented by the integer 5:

print(chr(5))

Example 2

Use chr() to return the Unicode character represented by the list [67, 111, 100, 101, 99, 97, 100, 101, 109, 121]:

Code
Output

All contributors

Contribute to Docs

Learn Python on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
    • With Certificate
    • Beginner Friendly.
      24 hours