The chr() function returns a string representing a character from the given Unicode code integer. For example the integer 'a' has a unicode code of 97, therefore, chr(97) returns the string 'a'.

Syntax:

chr(integer_code)
ExampleEdit & Run
print(chr(97))
Output:
a [Finished in 0.01409777999998596s]

print all the characters with a unicode code from 70 and 80

ExampleEdit & Run
for i in range(70, 80):
    print(chr(i))
Output:
F G H I J K L M N O [Finished in 0.012311898999996629s]

All the lowercase letters has Unicode values from  97,to 122, where 'a' has a code of 97 and 'z' has a code of 122, and the others are in between. We can print the lowercase letters using chr() as follows.

ExampleEdit & Run
for i in range(97, 123):
    print(chr(i), end = ' ')
Output:
a b c d e f g h i j k l m n o p q r s t u v w x y z [Finished in 0.012792179000030046s]

The  integer code value must be in the range 0-1114111 (0x10FFFF in base 16). If the argument is outside this range, a ValueError will be raised.

ExampleEdit & Run
print(chr(1114112))
Output:
ValueError: chr() arg not in range(0x110000) [Finished in 0.013242570000045362s]

more examples:

ExampleEdit & Run
for i in range(1000, 1020):
   print(chr(i), end = ' ')

print( end = '\n')

print('----------------------------------------------')

for i in range(10000, 10020):
    print(chr(i), end = ' ')
Output:
Ϩ ϩ Ϫ ϫ Ϭ ϭ Ϯ ϯ ϰ ϱ ϲ ϳ ϴ ϵ ϶ Ϸ ϸ Ϲ Ϻ ϻ ---------------------------------------------- ✐ ✑ ✒ ✓ ✔ ✕ ✖ ✗ ✘ ✙ ✚ ✛ ✜ ✝ ✞ ✟ ✠ ✡ ✢ ✣ [Finished in 0.013214828999991823s]

The ord() function serves exactly the opposite purpose, where you give it a character and it returns the unicode integer code of the character.