I am stuck on Modifying each element in a list.
My code prints:
[6, 10, 14]
This output appears to be correct to me, but I am getting the error message:
Oops, try again. double_list([0, 1]) resulted in an error: list index out of range
Here is my code: 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)