抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >


Python ASCII 字符串 转换

ASCII (American Standard Code for Information Interchange) 美国信息交换标准代码是基于拉丁字母的一套电脑编码系统,主要用于显示现代英语和其他西欧语言。它是最通用的信息交换标准,并等同于国际标准 ISO / IEC 646。ASCII 第一次以规范标准的类型发表是在 1967 年,最后一次更新则是在 1986 年,到目前为止共定义了 128 个字符。

ASCII 转字符

ASCII 转字符.py
def ASCIItostr():
try:
s = input()
s=s.split()
for i in s:
print(chr(int(i)),end="")
print()
except Exception as e:
print("",end="")

if __name__ == '__main__':

try:
while True:
ASCIItostr()
except EOFError:
exit()

字符转 ASCII

字符转 ASCII.py
def strtoASCII():
try:
s = input()
for i in s:
print(ord(str(i)),end=" ")
print()
except Exception as e:
print("",end="")

if __name__ == '__main__':

try:
while True:
strtoASCII()
except EOFError:
exit()

推荐阅读
Python BinaryConversion Python BinaryConversion Python Morse Python Morse Python Base Python Base Python Caesar Python Caesar Python MD5 Python MD5 Python RailFenceCipher Python RailFenceCipher

留言区

Are You A Robot?