input: Write a Python program to print the maximum number from a given list.
  
  ### Input:
  [5, 4, 2, 7, 12]
  
  ### Output:
  def max_num(nums):
      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, -7, -2]) == -1
  assert max_num([100, 200, 300, 400, 500]) == 500
  assert max_num([0]) == 0
  assert max_num([3, 3, 3, 3, 3]) == 3
output: def max_num(nums):
      max = nums[0]
      for num in nums[1:]:
          if num > max:
              max = num
      return max