input: Write a function to calculate the middle sum of a list of numbers.
  assert middle_sum([1, 2, 3, 4, 5]) == 3
  assert middle_sum([1, 2, 3, 4]) == 5
  assert middle_sum([10, 20, 30, 40, 50, 60]) == 70
  assert middle_sum([]) == None
output: def middle_sum(lst):
      if not lst:
          return None
      n = len(lst)
      mid = n // 2
      if n % 2 == 0:
          return lst[mid - 1] + lst[mid]
      else:
          return lst[mid]