Invalid syntax 10/11?


#1

This is my code:

pyg = 'ay'
new_word="teru"
print new_word[1:len(new_word)]
original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word=original.lower()
first=word[0]
new_word=word+first+pyg

new_word=new_word[1:]
print new_word
else:
print 'empty

And when I hit Save and Submit, it says
"Oops, try again. Your code did not run to end - see the console window for the error message."

And the console window says:
"File "python", line 13
else:
^
SyntaxError: invalid syntax"

Someone please help me


#2

the problem seems to be in this line:

print 'empty

you forgot a ' after empty, to mark the end of string


#3

Please mark your Q/A as solved, thanks in advance :smile:


#4

That's not the problem, tried that too


#5

this is the solution

pyg = 'ay'
new_word="teru"
print new_word[1:len(new_word)]



original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
    word=original.lower()
    first=word[0]
    new_word=word[1:]+first+pyg
    print new_word
else:
    print 'empty'