input: Write a function to return the maximum number in a list. If the list is empty, return None. The function should iterate through the list and keep track of the maximum value found.
  
  
  assert find_max([1, 15, 20, 6]) == 20
  assert find_max([10, 3, 5, 7]) == 10
  assert find_max([-5, -10, -2, -1]) == -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