input: Write a function to find the maximum number from a given list. If the list is empty, 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([-1, -5, -3, -10]) == -1
  assert max_num([0, 0, 0, 0]) == 0
  assert max_num([1]) == 1
  assert max_num([]) == None
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