input: Write a function to find the maximum number in a given list. The function should return the maximum value found in the list. If the list is empty, the function should return None.
  assert max_num([9, 2, 5, 6, 4, 1])==9
  assert max_num([-1, -5, -3, -2])==-1
  assert max_num([42])==42
  assert max_num([])==None
output: def max_num(lst):
      if not lst:
          return None
      return max(lst)