input: Write a function to calculate the minimum and maximum values in an array. The function should return a tuple containing the minimum value followed by the maximum value. If the array is empty, the function should raise a ValueError.
  assert min_max([3, 1, 4, 1, 5, 9]) == (1, 9)
  assert min_max([2, 7, 1, 8, 2, 8]) == (1, 8)
  assert min_max([10, -5, 0, 15, 20]) == (-5, 20)
  assert min_max([1]) == (1, 1)
  try:
      min_max([])
  except ValueError:
      pass
output: def min_max(arr):
      if not arr:
          raise ValueError
      return (min(arr), max(arr))