当前位置: 首页 > news >正文

python ord()函数

python ord()函数

python内建函数,参数一个字符。如果是字母,返回ASCII吗,如果是非ASCII字符,返回unicode编码

1 def test_ord():
2     print(ord('a'))
3     print(ord('A'))
4     print(ord(''))
5 
6 
7 test_ord()