Modifying an element of a list in a function


#1



Hi All, i'm geting the error code below for this exercise. Any help would be great.

Oops, try again. list_function([0, 6]) returned 6 instead of [0, 9]


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


#2

https://www.codecademy.com/en/courses/python-beginner-nzzVa/2/3

This line is the issue. It may be removed.

The argument x is the list to modify, by all rights.

x[1] = x[1] + 3
return x