10. Ending up 'error message "else" '


#1

I have been stuck on this for an hour! I have looked at other posts but can't find a solution to it.

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print oringinal

word = original.lower()
first = word[0]

new_word = word + first + pyg
new_word = new_word[1:(new_word)]
print new_word

else:
print 'empty'

Please tell me what is wrong with it.

Thanks !


#2

Spelling.

Missing keyword len


#3

mtf I have done what you have said but I am still coming up with the same error


#4

So the line now looks like this,

new_word =  new_word[1:len(new_word)]

?


#5

Yes it does mtf !...........


#6

It's ok mtf, I worked it out !


#7

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