input: Write a function to determine the maximum number from a given list of integers. If the list is empty then return None.
  def max_num(nums):
      if not nums:
          return None
      max = nums[0]
      for num in nums[1:]:
          if num > max:
              max = num
      return max
  
  assert max_num([5, 4, 2, 7, 12])==12
  assert max_num([10, 3, 8, 1])==10
  assert max_num([9])==9
  assert max_num([])==None
  assert max_num([-5, -2, -7, -1])==-1
output: def max_num(nums):
      if not nums:
          return None
      max = nums[0]
      for num in nums[1:]:
          if num > max:
              max = num
      return max