Pyglatin ending up HELP!


#1



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

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)]
 
else:
    print 'empty'


WHATS HAPPENING???!!!


#2

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


#3

Instead of print ing this slice ...

new_word[1:len(new_word)]

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

print new_word

#4

like this?

    new_word[1:len(new_word)]
    print new_word

#5

You are to store the slice,

in a variable named new_word,

new_word =


#6

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 ...

new_word[1:len(new_word)]

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

new_word = new_word[1:len(new_word)]

#7

thanks it worked!! :smiley:

someone can manually close this topic now


#8

A post was split to a new topic: Pyglatin


#9