Need Help Ending Up this PygLatin Excercise


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
print 'empty'

This is my code. When it processes, it prints "coincay" instead of "oincay". What am I doing wrong?


I have indentations, but the forum gets rid of them.


What does the first line here do? And then what does the second line do?


If you're not sure what new_word[1:] does, you could try printing it and seeing what displays.


Great idea! I did that, and it printed 'oincay"! :smiley: I just had to make new_word = new_word[1:] and then print new_word for it to accept it.


Well done! You could also have removed the new_word line and printed new_word[1:] instead.