Python: Lists & Functions, Lesson 14 Passing a Range to a Function is not written in proper English and has bugs:
This topic was archived by the moderator w/o a resolution. (By a moderator who claims not to like Codecademy; so why is he a moderator at all? Seems inappropriate to allow.)
Per the moderator, factoradic, the correct answer to Python: Lists & Functions, Lesson 14 Passing a Range to a Function is to pass in range(3), which does allow one to 'pass' the lesson. However, passing in range(3) does not adhere to the directions in the question.
The directions in the question read to "replace the ____ with a range() that returns a list containing [0, 1, 2]." With the way the body of the function is written, there is no int range one can pass to obtain a return comprising list[0,1.2].
Passing in range(3), as the program accepts and the former moderator states is the correct answer returns list[0,2,4].
List[0,2,4] != list[0,1,2]
Regardless of the former moderator's refusal to see this fact, this question is not written correctly. It's neither correct in it's English content, nor mathematically. There is no range one can pass into this function...
def my_function(x): for i in range(0, len(x)): x[i] = x[i] * 2 return x
...That will return x = [0,1,2] as the question's directions state the student is to return. Not only does the 'correct' answer per the moderator not adhere to the directions in English, but the only way to make them do so would be to change the body of the function and overload the method range() to accept floats as arguments. Therefore, not only is the English written poorly, the answer not mathematically correct, but the function as it's written is incorrect in its algorithm -- it has a logic error.
There's no way logically to get an output return of x=[0,1,2] as this question is written. Either the question is wrong or the 'answer' is wrong, and one or the other should be edited. There's no way you can make
List[0,2,4] = list[0,1,2,]. One of them has to be wrong.
Since in coding you're getting the wrong output or return than what is asked and expected, this code by definition has a bug in the form of a logic error. The topic should not have been archived. The bug needs to be fixed. The former moderator should not be refusing to see the bug. It's plainly there. If you can't get the output you're supposed to, that's a bug!