[Python] a random input string (more than five characters) and forming a list of ASCII codes for each character, and outputs.

A random input string (more than five characters) and forming a list of ASCII codes for each character and outputting
a.
Reference results are as follows:
enter a string: daecb
string of ASCII: [100,97, 101, 99, 98]

text=input("请输入一个字符串 :")
result = []
for t in text:
    result.append(ord(t))
print ("字符串的 ASCII 为:", result)

Here Insert Picture Description

Published 51 original articles · won praise 229 · views 10000 +

Guess you like

Origin blog.csdn.net/famur/article/details/105197623