The language is confusing in the instructions.
On line 6, replace the ____ with a range()
that returns a list containing [0, 1, 2].

It looks like the code could want print to return [0,1,2], in which case the range would be (0, 1.5, .5).


They want you to call range with arguments so that range produces the list [0, 1, 2]
0, 1, 2 are not those arguments, you have to come up with those yourself. What start stop and step values matches that list?

If we wanted produce [1, 4, 7], then we would do range(1, 8, 3) because it starts at 1, ends before 8 and has a step of 3.

The word return has a special meaning in programming, and print doesn't return anything, it isn't even a function! It is a statement, and it prints stuff!


This explanation really needs to be changed. This is the third thread currently visible on the board where people are confused by the wording. The explanation didn't point out the fact that range() generates a list that is not inclusive of the stop number. It is illustrated in the sample, but the text doesn't call attention to that feature. I entered range(0, 2, 1). When that didn't work, I thought I had misinterpreted the instructions and that they were actually looking for a range for which the function as a whole returns (0, 1, 2). So I entered range(0, 1, 0.5), but apparently range requires an integer. So then I tried changing the spacing and other dumb stuff, thinking I had made that kind of mistake somewhere. A clearer explanation would have saved me a lot of time.


You need to check the order: range(START,STOP,STEP). So the step isn't in the middle.
since the stop is not included you add 1 to the bigger number in the list:
optaining: range(0,3,1)


I don't understand how (3) doesn't work here. The description of range() says: If omitted, starts defaults to zero and step defaults to one.

With that being said, I've tried everything I think is feasible, but clearly I'm missing something.


One of my mistakes was just inserting the 3 inside, but you have to use range for it to work so your code should be:

print my_function(range(3))

I, like you may have, just forgot that for the range to work you must use it (haha), and this worked for me hopefully it helps others too.