chr
输入int, 返回ascii
ord
输入ascii, 返回int
Code:
In [1]: ord('a')
Out[1]: 97
In [2]: chr(97)
Out[2]: 'a'
chr
输入int, 返回ascii
ord
输入ascii, 返回int
Code:
In [1]: ord('a')
Out[1]: 97
In [2]: chr(97)
Out[2]: 'a'
本文标题:python中的chr和ord
本文链接:https://www.haomeiwen.com/subject/kxuwlttx.html
网友评论