i2tutorials

Chr() method in Python Built in Function

Chr() method in Python Built in Function

 

chr method in built in function returns a character of the given Unicode in the input.

 

Parameter

 

Example-1:

 

Use of negative integer

x = chr(-9)
print(x)

 

Output:

Chr () method in Python Built in Function

 

Example-2:

 

Use of float numbers

x = chr(9.85)
print(x)

 

Output:

 

Example-3:

 

Use of positive integer

x = chr(7)
print(x)

 

Output:

 

Example-4:

 

Use of complex numbers

x = chr(8+5j)
print(x)

 

Output:

 

 

 

 

Exit mobile version