Having Trouble with "Ending Up" In Pyg Latin


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#
this is what my code looks like

pyg = 'ay'

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


error message says "Oops, try again. It looks like new_word contains "whatway" instead of "hatway"
I've been using the word "what" when I type my code


I just want to pass this level man



#2

here:

new_word = new_word[0:len(new_word)]

you take a slice of new_word, but you want the second letter (index one) till the end, you have first letter till the end (bit of a pointless slice)


#3

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