Please help me with my code! The error message says that the list index is out of range. Also, when I call median([1,2,3,4,5]), it did not return 3 but 4. I don't know why.
def median(numbers): median_number = 0 sort = sorted(numbers) count = len(sort) if count % 2 == 0: median_number = (sort[count] + sort[count + 1]) / 2.0 else: median_number = sort[(count + 1) / 2] return median_number print median([1,2,3,4,5])