This might be something really simple but I've been stuck for a while and can't find what's up. My code is returning the error "Oops, try again. median([4, 5, 5, 4]) returned 4.0 instead of 4.5". Any advice?
def median(lst): in_order=sorted(lst) length=len(in_order) if length%2==0: mid1=in_order[length/2-1] mid2=in_order[length/2] return float((mid1+mid2)/2) else: midpoint=int(length/2) return in_order[midpoint]