What is wrong with my code?


#1

What is wrong with my code? It shows no error in the window where it prints all the stuff, but codecademy is saying "Oops, try again. double_list([0, 1]) returned [0, 1] instead of [0, 2]". Here is my code:

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

# Don't forget to return your new list!
print double_list(n)

#2

The indentation is missing.

Eg.

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