The pyg latin code i wrote works but its not accepting it?


It shows in the console correctly how the word should be written in pyg latin, but it has the error ‘It looks like you printed the correct translation of “cat”, but make sure to set new_word equal to the slice as well.’ … this is the code i wrote:
pyg = ‘ay’

original = raw_input(‘Enter a word:’)

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

I’m not really sure what it meant by 'make sure to set new_word equal to the slice as well", because i thought that’s what i did when i wrote new_word[1:len(new_word)] …i’m not sure how to fix this and it’s not letting me move on until i do. I know i could continue if i copy and paste the code from somewhere, but i’d like to know what’s wrong with it first.



make sure to set new_word equal to the slice as well

look at here


you did a slice of new_word here.right? so you have to set this value to the variable named new_word.
now print the variable instead of writing the whole slice again.


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