Exercise n° 10: Ending Up


I don't understand what's wrong with my code

This is the error message that comes:
Oops, try again. It looks like new_word contains "hellohay" instead of "ellohay"!

pyg = 'ay'

original = raw_input('Enter a word:')

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


You are missing one thing, you need to add first and pyg to this line,

like this,

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




you take a slice of new_word, but you don't store this slice anywhere?


and the rest stays the same??????


No also refer to what @stetim94 said. :slight_smile:


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