#14 Passing the range


#1



ok, I obviously don't understand range, please help


Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: object of type 'int' has no len()


def my_function(x):
    for i in range(0, len(x)):
        x[i] = x[i] * 2
    return x

print my_function(3)


#2

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

lets look at line 6:

print my_function(____)

so now we need to replace ___ with range(x) where x is a value so we get [0,1,2] as list


#3

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