Python: chr () function

description

CHR () with a range (i.e., 0 ~ 255) as a parameter to an integer within a range (256), and returns a corresponding character.
grammar

The following is the syntax chr () method:

chr(i)

parameter

i -- 可以是10进制也可以是16进制的形式的数字。

return value

The return value is an integer corresponding to the current ASCII characters.
Examples

The following shows an example of using chr () method:

>>> print chr (0x30), chr (0x31), chr (0x61) # hexadecimal

0 1 a

>>> print chr (48), chr (49), chr (97) # Decimal

0 1 a

Guess you like

Origin blog.csdn.net/weixin_44523387/article/details/93371827