Median price

Write median(prices) that returns the median of a non-empty list: the middle value when sorted, or the average of the two middle values when the count is even. Do not change the list you are given.

median([40, 2.5, 25])      ->  25
median([40, 2.5, 25, 10])  ->  17.5
def median(prices):
    ...