input: Write a function to optimize the program that finds the maximum number in a list. If the input list is empty, return None.
  assert max_num([9, 2, 5, 6, 4, 1])==9
  assert max_num([2, 5, 6, 4, 9, 1])==9
  assert max_num([9, 9, 9, 9])==9
  assert max_num([])==None
output: def max_num(lst):
      if not lst:
          return None
      return max(lst)