input: Write a function to find and return the maximum number from a given list of integers. If the list is empty, return None. If the list contains only one element, return that element.
  assert max_num([5, 4, 2, 7, 12])==12
  assert max_num([3, 5, 10, 1])==10
  assert max_num([4])==4
  assert max_num([])==None
output: def max_num(lst):
      if not lst:
          return None
      return max(lst)