Using an element from a list in a function; What's wrong?


TypeError: 'function' object has no attribute 'getitem'

Replace this line with your code. Do not remove the backticks that are above or below this line.

def list_function(x):
    return list_function[0]

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


You are trying to return value from the function name instead of from passed list.

BTW, you supposed to return value from index one.


Ah, silly me >.< should return x[1]. Thank you!