PygLatin 10/11 error


#1

Hi. I seem to have this issue with the 10th exercise. My code is the following:

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:len(new_word)]
print original
else:
print 'empty'

However, when ever I try to save and continue, I get the following message:

Oops, try again. It looks like new_word contains "pigpay" instead of "igpay"!

This happens no matter what I try. I believe that it is an error on codecademy's side because something similar happened in the website course where I would have everything correct but it still would not accept it. Please help, I really want to progress.


#2

This is my code:
pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print original
word = original.lower()
first = word[0]
new_word =word + first + pyg
new_word = new_word[1:len(new_word)]
print new_word

else:
print 'empty'

I had the same problem too, check the end of "new_word" part


#3

I changed "print original" to "print new_word" and got it to work out correctly. I don't recall seeing anything that said to change this, but it works for me.


#4

You had to change that because if you didnt it would print the original instead of the new_word which has all the changes in it. so if you leave it at print original it makes all that code obsolete


#5

Hi folks, thanks for the response. I figured it out in the end, I said this:

transformation = new_word[1:len(new_word)]
new_word = transformation

It accepted it, and I got it to print new_word in the next exercise.

Thank you all so much for the help and I am so terribly sorry if I wasted your time!


#7

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print original.lower()
word = original.lower()
first = word[0]
new_word = word[1:] + first + pyg
new_word[1:len(new_word)]
print new_word


#8

Hi, I use your code and it works!!!

But I don't know why the first new_word should be defined in word[1:]

Will the second character of the word be deleted?

Thanks a lot!