Syntax Error for Exercise 10 Ending Up


Syntax Error for my else statement, not sure where I went wrong, this is the error I get:
File “python”, line 12
SyntaxError: invalid syntax

I expected my code to run without errors and prompt me to input a word to be translated, but instead I run into that error, any suggestions? My code is below:

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


From the variable word all the lines of code before else should be inside of if.


Thank you! That was a dumb mistake on my part.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.