In Ending Up, following the instructions exactly will result in this block of code along with an error message when submitted
pyg = 'ay' original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): print original else: print 'empty' word = original.lower() first = word new_word = [1:len(new_word)]
This is because of the following errors:
word needs to be placed before
[1:len(new_word)] in order for there to even be a variable to index
(new_word) in the index should be
new_word is not yet defined so how can it find the length of itself?
3) Inputting the code with the following changes will not complete the task, because the resulting print will not be properly translated into Pig Latin, but will display the second to last letter of the variable
original. The lesson program will tell this to you, but the instructions do not tell you to concatenate like so:
new_word = word[1:len(word)] + first + pyg
to create a proper translation into Pig Latin. My mistake was setting
new_word equal to
[1:len(new_word)], which is consequently what the lesson's instructions tell you to do, instead of leaving the
word + first + pyg intact while typing
word in the concatenation mentioned.
I am extremely disappointed with the following error as it shows either the website did not properly test this portion of the code from the eye's of a new user or that since all the content instruction for this language will soon be re-formatted that Code Academy did not care to correct this mistake. For a service I was contemplating subscribing to I am not pleased that this error in instruction was made by coders looking to sell a service to users looking to learn.
EDIT: For accuracy pertaining to the actual code that the lesson starts you out with