The [chr(i)] function in python is used to return the Unicode character corresponding to the integer i. The parameter i is an integer, and the value range must be [0 - 1114111 (hexadecimal) set to 0x10FFFF)], otherwise a ValueError will be raised.
The function of chr(i) is to return the Unicode character corresponding to the integer i.
For example, chr(97) returns the string a, chr(8364) returns the string €. Its function is the opposite of the ord() function.
Note:
The parameter i is an integer, and the value range must be between 0 - 1114111 (0x10FFFF in hexadecimal), otherwise a ValueError will be raised.
Example:
Related learning recommendations: python tutorial
The above is the detailed content of What is the chr() function in python. For more information, please follow other related articles on the PHP Chinese website!