input: Write a function to find the maximum number from a given list of integers. The function should return the maximum number.
  
  def max_num(nums):
      return max(nums)
  
  assert max_num([5, 4, 2, 7, 12]) == 12
  assert max_num([-1, -5, -2, -7, -12]) == -1
  assert max_num([0, 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_value = nums[0]
      for num in nums:
          if num > max_value:
              max_value = num
      return max_value