13) double_list([0, 1]) returned [0, 1] instead of [0, 2] error


#1



https://www.codecademy.com/courses/python-beginner-nzzVa/3/2?curriculum_id=4f89dab3d788890003000096#


When I submit the code it only multiply the first variable and not the rest of the list so for instance i would submit a list of 3,5,7 i would get in return 6,5,7 and im not sure why.


n = [3, 5, 7]


# Don't forget to return your new list!
def double_list(x):
    for i in range(0,len(x)):
        x[i]=x[i]*2
        return x

print double_list(n)


#2

put return at same indent as for loop


#3

Ah that did it thank you very much