12 lists and functions


#1

I'm stuck on this one and I'm not sure why.

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)

double_list(n)

its saying this:

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

Can anyone identify what I've done wrong here? Thank you


#2

I'm having the same problem.

n = [3, 5, 7]

def total(numbers):
result = []
for i in range(len(numbers)):
result = result.append(i)
return result

def totalh(p):
for i in range(len(p)):
empty = []
empty = empty.append(i)
return empty


#3
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)