I want to know what is bigger? Sum of numbers which index gives 1 or the sum of first half of the list. And I got this error.
TypeError: 'function' object is not subscriptable
def funky2(b):
c = checker[:len(b)/2]
a = sum(b) / len(b)
if a > sum(c):
return f'Statistic means is more than sum of 1 to half of list'
else:
return f'Statistic means is less than sum of 1 to half of list'
def checker(list):
b = []
for elem in list:
if list.index(elem) % 3 == 1:
b.append(elem)
return funky2(b)
print(checker([1,2,3,4,5,6,7,8,9]))