PygLatin : Correct word printed but wrong code?


#1



pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    print original
    word = original.lower()

else:
    print 'empty'
first = word[0]
new_word = word+first+pyg
print new_word[1:len(new_word)]


!ERROR BOX:!
It looks like you printed the correct translation of "anjney", but make sure to set new_word equal to the slice as well.your code.


#2

Hi, @valord ,

You need to assign the final slice that represents the solution to new_word, then display the value of new_word.


#3

Mind to copy and correct my code and comment it??


#4

Instead of this ...

print new_word[1:len(new_word)]

... you should first assign the slice to new_word, as follows ...

new_word = new_word[1:len(new_word)]

... or like this ...

new_word = new_word[1:]

Then, display it ...

print new_word

#5

Thank you very much!


#6