Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Python – Find String from Unicode Integer – chr() Function with Examples

chr() function is used to find the character in the form of string in Python, from an input value (i – integer) that represent the unicode point of that character.

chr() function is a part of Python Built-in Functions.

 

Syntax of chr() Function

The syntax of chr() function in Python is:

 

Parameters of chr() Function in Python

i – Where i is any valid integer from 0 to 1,114,111.

 

Compatibility

chr() function is available and compatible with both Python 2.x and 3.x.

 

Return Value of chr() Function in Python

chr() function returns the string representing a character whose Unicode code point is the integer i for the given input.

 

chr() Function Exception

If parameter i is outside the range of 0 to 1,114,111 then the chr() throw a ValueError.

 

Python chr() Function Example 1


Output:
R
#
ӎ
f
ո

 

Python chr() Function Example 2


Output:
Error

LearnAndLearn.com © 2018 - All rights reserved