Home  >  Article  >  Backend Development  >  What is the chr() function in python

What is the chr() function in python

silencement
silencementOriginal
2019-05-20 14:49:3680312browse

What is the chr() function in python

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:

What is the chr() function in python

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use python randintNext article:How to use python randint