input: Write a function to return the maximum number from a given list of integers.
  
  def max_num(arr):
      if len(arr) == 0:
          return None
      max_val = arr[0]
      for num in arr[1:]:
          if num > max_val:
              max_val = num
      return max_val
  
  assert max_num([5, 4, 2, 7, 12]) == 12
  assert max_num([1, 2, 3, 4, 5]) == 5
  assert max_num([-1, -2, -3, -4, -5]) == -1
  assert max_num([]) == None
output: def max_num(arr):
      if len(arr) == 0:
          return None
      max_val = arr[0]
      for num in arr[1:]:
          if num > max_val:
              max_val = num
      return max_val