10. Ending up 'error message "else" '


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

print 'empty'

Please tell me what is wrong with it.

Thanks !



Missing keyword len


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


So the line now looks like this,

new_word =  new_word[1:len(new_word)]



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


It's ok mtf, I worked it out !


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