Passing a range into a function


My code is not behaving incorrectly I just do not understand what's happening. It is correct and prints out [0, 2, 4] .

def my_function(x):
    for i in range(0, len(x)):
        x[i] = x[i] * 2
    return x
print my_function([0, 1, 2]) # Add your range between the parentheses!


the exercise validates range() is present and outputting the right list, you don't use range()


Oh, okay it just made it sound like it was looking for you to use the range function twice but that makes sense. Thank you


yea, the exercise even gave a hint:

print my_function(____) # Add your range between the parentheses!

that the function range should also be the function call argument

issue resolved?


Yes thank you very much