input: Write a python function to calculate the median of a list of numbers.
  assert median([1, 3, 5, 8, 12]) == 5
  assert median([1, 2, 3, 4, 5, 6]) == 3.5
  assert median([7, 8, 12, 13, 15]) == 12
  assert median([1, 2, 2, 3]) == 2
output: def median(lst):
      lst.sort()
      n = len(lst)
      mid = n // 2
      if n % 2 == 0:
          return (lst[mid - 1] + lst[mid]) / 2
      else:
          return lst[mid]