Lesson 10 Ending Up - Stuck


Lesson 10 - Ending Up

Oops, try again. word should contain the .lower()-case version of original.

Not sure why it keeps throwing this error. I realize my code doesn't use both the "word" and "original" variables, which for some inexplicable reason Codecademy decided to change around for random chapters in this. However I've adjusted the variable names to compensate without success. Any idea what I am missing here?


pyg = 'ay'

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


Try setting the raw input equal to an original variable, and then setting word equal to original.lower(). Your code should work, but the code checker is sometimes picky.


thx! but but I still got an error


You are missing the 'original' variable. That's the word that will be modified with later lines of code.

It should look like original =


This code is giving suggestion to add slice…not getting…please help

pyg = ‘ay’

original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
print original
new_word=word + first + pyg
print new_word[1:len(new_word)]
print ‘empty’


There’s a good site that has the answers and y’all can try to understand the wrong things like i did


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