返回单个字符的 Unicode 码位,是 chr() 的反函数。
chr()
c
整数
print(ord("A"), ord("a"), ord("中")) print([ord(c) for c in "Py"])
65 97 20013 [80, 121]