input: Write a python function to find the median of a list of numbers.
  assert median([3, 4, 1, 2, 5]) == 3
  assert median([7, 8, 5, 6, 9]) == 7
  assert median([1, 3, 3, 6, 7, 8, 9]) == 6
  assert median([1, 2, 3, 4, 5, 6, 8, 9]) == 4.5
output: def median(lst):
      lst.sort()
      n = len(lst)
      if n % 2 == 1:
          return lst[n // 2]
      else:
          mid1 = lst[n // 2 - 1]
          mid2 = lst[n // 2]
          return (mid1 + mid2) / 2