I'm getting the right result, but it's not accepting it


#1



https://www.codecademy.com/en/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


Everything works correctly. I'm getting the end result that I need to, but it's not allowing me to progress because I don't think I did it in the way I am supposed to.

Error Message: Oops, try again. It looks like you printed the correct translation of "python", but make sure to set new_word equal to the slice as well.


When I input "Python", I get ythonpay, which is what I'm supposed to, but it's asking me to set new_word equal to the slice. Help?


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


#2

@abdullah.hashsham,

new_word = new_word[1:len(word)]

#3

Oh, thank you! I don't know how I didn't think of this. Thanks again!


#4

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