I want to write a function that determines whether there's an odd or even number of elements in an array.
python
def middle_element(list):
if len(list)%2 == 0:
return 'Even'
else:
return 'Odd'
However, I get --> 'function object is not subscriptable.' Thanks for reading, helping me out!