input: Write a function to find and print the maximum number from a given list. The function should return the maximum number found in the list. If the list is empty, the function should return None.
  assert max_num([5, 4, 2, 7, 12])==12
  assert max_num([8, 15, 3, 6])==15
  assert max_num([34, 21, 45, 12])==45
  assert max_num([])==None
output: def max_num(lst):
      if not lst:
          return None
      return max(lst)