Wrong answer for '14. Passing a range into a function' passes milestone?


#1

It seems that in 14. Passing a range into a function, passing the answer range(3) passes the milestone as a correct response -- but shouldn't. Without being fed into the function, this range does return the desired result: [0,1,2]. However, in this milestone, that range is doubled by the my_function(x) function, so it actually returns: [0,2,4]. Yet it passes the milestone check as a correct solution. Or maybe it's the instructions that are looking for the wrong result?


#2

from the instructions:

On line 6, replace the ____ with a range() that returns a list containing [0, 1, 2]

under the hood, range() is a function, which returns a list. so range does return the correct list, then my_function doubles it. but the instructions refer to that range() returns a list ([0, 1, 2]), then my_function doubles it, but that is not what the instructions refer to


#3

Ah, you're absolutely right -- thank you.


#4

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