mardi 24 mars 2015

-Python- Trying to make a program everytime it says there is an invalid syntax [on hold]

I'm trying to make an encoder/decoder program but everytime i run this code it says there is an invalid syntax but doesn't highlight what it is. Does anyone know whats wrong?



new_message = []
de = int(input("""
Do you wish to:

Encode - 1
Decode - 2
Exit - 3

"""))
if de == 1:
message = input("What is your message? \n")
for letters in range len(message):
new_message[0:1] = (chr(letters)+ 5)
print (new_message)
elif de == 2:
message = input("What is your message? \n")
for letters in range len(message):
new_message[0:1] = (chr(letters)- 5)
print (new_message)
else:
input("Press Enter to Exit\n")

Aucun commentaire:

Enregistrer un commentaire