10/18


#1

def list_function(x):
return x[1]
x[1] = x[1] + 3
return x

n = [3, 5, 7]

print list_function(n)
What's wrong with my code?
Could you please figure it out? Thanks


#2

Get rid of "return x[1]" and it should work.


#3

As soon as you call "return" the program leaves the function.
anything below "return" will not we executed.


#5

`def list_function(x):
x[1] = x[1] + 3
return x

n = [3, 5, 7]
print list_function(n)`
this should work


#6

def list_function(x):
return x[1]

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

Nothing worked, but this did work for me... Its a function you need to create