input: Write a function to return the maximum number in a list. The function should iterate through the list, compare each element to find the maximum value, and return it. If the list is empty, the function should return None.
  assert find_max([1, 15, 20, 6])==20
  assert find_max([10, 2, 50, 30, 40])==50
  assert find_max([-1, -5, -3, -2])==-1
  assert find_max([])==None
output: def find_max(lst):
      if not lst:
          return None
      max_val = lst[0]
      for num in lst:
          if num > max_val:
              max_val = num
      return max_val