10. Check Yourself



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'


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

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


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