Not understanding why this does not work


Here is the 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)`

The exercise is really straight forward, why does not work? The directions say to use the existing code and replace n with x, but it does not work!


They failed to point out that returning the value should not be in the loop.


That's implied with that the function should finish its job!

And it's not possible to tell from you post that it was inside your loop - take care that any code you post is intact and reproduces what you describe.