input: Write a python function to find the median of a given list of numbers.
  assert median([4, 5, 2, 7, 1]) == 4
  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)
      mid = n // 2
  
      if n % 2 == 1:
          return lst[mid]
      else:
          return (lst[mid - 1] + lst[mid]) / 2