Manual
Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. For example, ord(‘a’) returns the integer 97 and ord(‘€’) (Euro sign) returns 8364. This is the inverse of chr().
直译
给定一个字符串表述的Unicode字符,返回一个能代表该字符Unicode代码点的整数。例如:ord(‘a’)返回整数97,ord(‘€’)(欧元符号)返回8364。该函数与chr()互为反函数。
实例
>>> chr(97)
'a'
>>> ord('a')
97
>>> ord('i')
105
>>> ord('>')
62
ord()函数用于将一个Unicode字符转换为对应的编码点,即返回一个整数。例如,ord('a')返回97,ord('€')返回8364。它是chr()函数的逆操作。
2126

被折叠的 条评论
为什么被折叠?



