List and functions where am i getting it wrong


#1

def list_function(x):
    a= x[1]+3
    n[1]=a
    return n[1]
n = [3, 5, 7]
list_function(n)
print list_function(n)

#2

can you include the exercise url and the error message?


#3

error


#4

here:

n[1]=a

you shouldn't use n here, this means your function will only work for one list instead of every list passed into the function as argument, use the function parameter instead like you did on the line above

also, return the whole list, not just the item at index 1


#5

got it
thanx!!! for the help


#6