I did it absolutely correct and yet it says my coding is incorrect and returns 4.0 when it actually returns 4.5 as intended.

def median(numbers):

numbers.sort()

middle = len(numbers) // 2

if len(numbers) % 2 == 0:

median = float((numbers[middle] + numbers[middle - 1]) / 2)

else:

median = float(numbers[middle])

return median

print(median([102, 56, 34, 99, 89, 101, 10, 54]))