10. Ending Up - code works but


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


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
else:
    print 'empty'


#2

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


#3

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


#4

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.


#5

Best Solution out there. Works flawlessly