Exercise n° 10: Ending Up


#1

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
    new_word[1:len(new_word)]
    print new_word
else:
    print 'Empty'

#2

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


#3

here:

new_word[1:len(new_word)]

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


#4

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


#5

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


#6

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