Program executing its task, but still getting error message!


#1



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

The error message says, "Oops, try again. It looks like you printed the correct translation of "zebra", but make sure to set new_word equal to the slice as well.

Have I not set new_word equal to the slice? If I am wrong, what should new_word be equal to and what should I change?

pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

Instead of printing this line, create new_word right after first. When writing the slice, use new-word, not word.


#3

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