input: Write a function to find the maximum value in a list.
  assert max_val([100, 2, 900, 32, 4]) == 900
  assert max_val([1, 2, 3, 4, 5]) == 5
  assert max_val([-10, -20, -30, -40, -5]) == -5
output: def max_val(lst):
      if not lst:
          return None
      max_value = lst[0]
      for num in lst[1:]:
          if num > max_value:
              max_value = num
      return max_value