Need help on 9/18 List and Functions


My code isn't working at all

def list_function(x):
return x(3)

n = [3, 5, 7]
print list_function(n)

Can any body help me?


x(3) isn't a thing. If you want to obtain a number from the list using the index you'll need to do x[index]. Also be aware that the index starts at 0. So to get the 2nd number from your list you need to do x[1].


Hi there!

instead of:

return x(3)

It should be:

return x[1]

This is simply because the task just wants you to print the number at index 1 which in this case is 5.

Hope this helps



thanks for the help man!


yeah it's really working..


Thanks guys.:relaxed: