Having Trouble with "Ending Up" In Pyg Latin


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



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)


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