Oops, try again. median([4, 5, 5, 4]) returned 4.0 instead of 4.5
I expect the using half and other half will give me the two center numbers. I then use them to call those numbers and average them.
def median(numbers): sort=sorted(numbers) even = (len(numbers)%2) if even == 0: half = (len(sort)/2) otherhalf = ((len(sort)/2)-1) middle= float((sort[half] + sort[otherhalf])/2) else: middle = sort[len(sort)/2] return middle