13/18 list and functions. help?


#1




Oops, try again. double_list([0, 1]) returned [0, 1] instead of [0, 2]


how come the code doesn't multiply the list by 2?


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

Check the indentation on your return statement. It should match that of for.


#3

it worked! thank you!


#4

2 posts were split to a new topic: Can't figure what's wrong with my code


#5