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