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):
    even = (len(numbers)%2)
    if even == 0:
        half = (len(sort)/2)
        otherhalf = ((len(sort)/2)-1)
        middle= float((sort[half] + sort[otherhalf])/2)
        middle = sort[len(sort)/2]
    return middle


currently first the division happens:

9 / 2

so then the number will be divided and floored, and then cast to a float. You will need to change where float gets applied


I moved the float to each inside the division - thanks.