我目前正在处理此代码..
message = input("Enter ASCII codes: ")
decodedMessage = ""
for item in message.split():
decodedMessage += chr(int(item))
print ("Decoded message:", decodedMessage)
#1st Run:
Enter ASCII codes: 97
Decoded message: a
#2nd Run:
Enter ASCII codes: 9797
Decoded message: ♅
我想要的结果是: aa 来自 97 和另外 97 个 ascii 代码。如何才能做到这一点?
我想要这样。
ord_username = input("Enter Username:")
letters = str(ord_username)
ordlist=[]
z=""
for letter in letters:
number = ord(letter)
ordlist.append(number)
for i in ordlist:
z += str(i) + ""
print (z)
#1st Run:
Enter Username:a
97
#2nd Run:
Enter Username:ab
9798