如何使用 Python 查找字符的 ASCII 值?
pythonprogramming
python 中的 ord 函数给出字符的序数值(ASCII)。您可以使用此函数查找 ascii 代码,如下所示
示例
s = "Hello" for c in s: print(ord(c))
输出
这将给出输出
72 101 108 108 111
python 中的 ord 函数给出字符的序数值(ASCII)。您可以使用此函数查找 ascii 代码,如下所示
s = "Hello" for c in s: print(ord(c))
这将给出输出
72 101 108 108 111
如果您发现内容有误或提出修改建议,请随时向我们发送 E-mail 邮件:
421660149@qq.com
您的建议已发送到 W3schools。