Pyglatin ending up HELP!


stuck here:

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

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



here you to take the slice:

print new_word[1:len(new_word)]

but the exercise wants you to store this result in new_word, and then print it, not print it directly


Instead of print ing this slice ...


... assign that slice to new_word, and then ...

print new_word


like this?

    print new_word


You are to store the slice,

in a variable named new_word,

new_word =


This line consists of the slice you need, provided that the preceding code that you have is correct, but it does not save the slice anywhere ...


To save the result as new_word, make it into an assignment statement, as follows ...

new_word = new_word[1:len(new_word)]


thanks it worked!! :smiley:

someone can manually close this topic now


A post was split to a new topic: Pyglatin