Hi, i am a newbie to python 2.7 , trying to create a simple program, which takes an input string from the user, converts all the characters into their ascii values, adds 2 to all the ascii values and then converts the new values into text. So for example, if the user input is "test" , the output should be "vguv".
This is the code i have written so far :
message = input("enter message to encode")
for ch in message:
message2 = ord(ch) + 2
print "\n\n"
encodedmessage = ""
for item in message2.split():
encodedmessage += chr(int(item))
print ("encoded msg in text : "), encodedmessage
It doesnt seem to be working properly, any help would be appreciated. Thanks.