Why indexing the middle element gives the wrong median here.
def median(numbers): mid = len(numbers) // 2 return numbers[mid] print(median([7, 1, 3, 9, 5]))
What is the bug in this median function?