# 13/18

#1

"""
n = [3, 5, 7]
def double_list(x):
for i in range(0, len(n)):
x[i] = x[i] * 2
return x
print double_list(n)
"""
the error i get is: Oops, try again. double_list([0, 1]) resulted in an error: list index out of range
whats wrong with this code?

#2

#3

on this line

``for i in range(0, len(n)):``

you are using the length of the list n you created outside the method which means that no matter the list you pass the range will always be form 0 to 2. to correct it you have to do

``for i in range(0, len(x)):``

#4

i've done that and now the error is Oops, try again. double_list([0, 1]) returned [0, 1] instead of [0, 2]....i really cant figure out whats wrong with this piece of code

#5
``````n = [3, 5, 7]

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

print double_list(n)``````

this worked for me.
the len(x) seems to be only problem in your case as rydan previously mentioned. try this and report back. hope u figure it out

#6

yay it finally worked with your code. thanks!

#8

Mine keep saying double_list not defined help!

n = [3, 5, 7]
def double_list(x):
for i in range(0, len(x)):
x[i] = x[i] * 2
return x
print double_list(n)

#9

But you have to take care on the indentation:
for i in range(0, len(x)):
--------x[i] = x[i] * 2
return x

FOR and RETURN have to be on the same indentation level!!