10. Check Yourself


#1



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


My output is right but I didn't set it equal to the slice??

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


#Defining ay to
pyg = 'ay'
# Original word input
original = raw_input('Enter a word:')
#If then to creat the pig latin
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'


#2

There should be an else: before print "empty".

The instructions ask that we assign the slice to new_word before printing.


#5

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