input: """
  Optimize the following Python program to find the maximum number in a list.
  >>> max_num([9, 2, 5, 6, 4, 1])
  9
  """
  def max_num(list):
    return max(list)
output:     
      if not list:
          return None
      max_value = list[0]
      for num in list:
          if num > max_value:
              max_value = num
      return max_value
  