okay well i started python challenge and i did the warmup etc. i got to the first one, from looking at the hint thing the letters are just + 2 and find the new letter. so i want to make a program where i can just type in the whole message and have it decoded from that. i made it or at least i thought i did but when i try to do it im getting errors. what did i do wrong? heres my code
#decodes pygame challenge message
# enter letter change to number add 2 then convert back to letter
# display message
import string
def main():
message = raw_input("Enter your message.\n")
for ch in message.split():
value = ord(ch) + 2
newLetter = chr(value)
Nmessage += newLetter
print Nmessage,
heres the error message i get
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
main()
File "C:/Python25/pygameDecoder.py", line 9, in main
value = ord(ch) + 2
TypeError: ord() expected a character, but string of length 5 found
obviously its trying to ge the numeric ordinate of the whole word but shouldnt ch mean just the charcter? isnt that looping it through each character of the split words?
any help is appreciated
thanks
heyhohey