input: Write a python function to find the maximum value in an array.
  assert max_val([1, 2, 3, 4, 5]) == 5
  assert max_val([5, 4, 3, 2, 1]) == 5
  assert max_val([-1, -2, -3, -4, -5]) == -1
output: def max_val(arr):
      max_value = arr[0]
      for num in arr:
          if num > max_value:
              max_value = num
      return max_value