So I was creating a median calculator, and I came upon this error (the heading)
def median(x):
#finds the median of a column
if len(x) % 2 == 0:
y = len(x) / 2
medknot = x[y] + x[y][-1]
med = medknot / 2
return med
elif len(x) % 2 == 1:
y = len(x)//2
med = x[y]
return med
l1 = [5, 6, 7, 8, 9, 6, 5, 5]
print(median(l1))
What is the error in my code?
