Need Help Ending Up this PygLatin Excercise


#1

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
new_word[1:]
print new_word
else:
print 'empty'

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


#2

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


#3

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


#4

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


#5

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.


#6

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