Hello everyone I'm currently new to python, and I'm trying to write a program where the user can input a message and the output will show the numeric code of the message, but at the same time I need to write the numeric code to an additional file.
So for example the user inputs the word "Hello" The user will see the output "72 101 108 108 111"
Now that output should also be copied into an external document labeled as my "EncryptedMessage.txt"
The numbers are written to the folder however there is no space between them so when I put it in the decoder it will not decode, is there anyway for me to get a space between them?
Example of my coding.
def main():
outfile = open("EncryptedMessage.txt", "w")
messgage = " "
message = raw_input("Enter a message: ")
for ch in message:
ascii = ord(ch)
outfile.write(str(ascii) )
print ascii,
outfile.close()
Sorry I'm not really good with programming terms.