input: Write a function to find the maximum number in a list. The function should iterate through the list and keep track of the maximum value encountered so far. Once the iteration is complete, the function should return the maximum value.
  
  def max_num(list):
    max_num = list[0]
  
    for num in list:
      if num > max_num:
        max_num = num
    
    return max_num
  
  assert max_num([9, 2, 5, 6, 4, 1])==9
  assert max_num([4, 7, 2, 1, 9, 3])==9
  assert max_num([0, 0, 0, 0, 0, 0])==0
  assert max_num([-5, -3, -9, -7, -1, -2])==-1
  assert max_num([12])==12
output: def max_num(list):
    max_num = list[0]
  
    for num in list:
      if num > max_num:
        max_num = num
    
    return max_num