10. Ending Up - code works but



Oops, try again. It looks like you printed the correct translation of "random", but make sure to set new_word equal to the slice as well.

I get the result I expect to get, which is the word "random" translated to PygLatin, and yet I still return the error above in CodeAcademy. If I use the code implied by the tutorial i.e. new_word = new_word[1:len(new_word)], then I get an error at the colon in this line. Also, is it really intended that I refer to the variable, new_word, in the string defined as that very variable?!

pyg = 'ay'

original = raw_input('Enter a word:')

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


seems SCT (submission correctness test) isn't a huge fan of your solution, while i think it is actually a good solution

you should set new_word:

new_word = word + first + pyg

and then take a slice of new_word


A post was split to a new topic: Submission correctness test


That error message is my doing, back from when Lalith let me improve SCT's where I noticed people were getting stuck or it was acting particularly stupidly.

Learners used to get stuck because they were printing the correct translation, but the SCT was only looking at the variable and would tell them that their translation was incorrect.

So I added an error message for a common mistake instead of changing the requirement. I wouldn't change it now even if I could, following specifications is important too.


Best Solution out there. Works flawlessly