函数ord(x)是返回字符x对应的Unicode编码
#注意看清楚是字符,不是字符串
给数字会报错
>>> ord(5)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
ord(5)
TypeError
函数ord(x)是返回字符x对应的Unicode编码
#注意看清楚是字符,不是字符串
给数字会报错
>>> ord(5)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
ord(5)
TypeError