input: Write a function to find the maximum number in a given list. If the list is empty, return None.
  
  assert max_num([5, 4, 2, 7, 12])==12
  assert max_num([3, 8, 1, 2])==8
  assert max_num([4])==4
  assert max_num([])==None
output: def max_num(lst):
      if not lst:
          return None
      return max(lst)