10. Ending up


#1

Hey guys! I'm having trouble getting the last part in ending up right. I've searched the forum, but can't find any help.

This is my code:

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

When I write for example cat, this is the error I get:
"Oops, try again. It looks like you printed the correct translation of "cat", but make sure to set new_word equal to the slice as well."
I have tried many things to solve this, but nothing I have tried works. Anyone that can help me?Preformatted text


Ending Up
#2

this slice:

new_word[1:len(new_word)]

you should store in new_word (in essence updating the variable) and then print it


#3

Thanks Stetim, I got it working now :slight_smile:


#4