input: Write a function to calculate the maximum, minimum, and average values from a given sequence of numbers. If the sequence is empty, the function should return None for all three values.
  assert calculate_metrics([3, 4, 5, 6, 21, 8]) == (21, 3, 8.166666666666666)
  assert calculate_metrics([1, 1, 1, 1]) == (1, 1, 1.0)
  assert calculate_metrics([-1, -2, -3, -4, -5]) == (-1, -5, -3.0)
  assert calculate_metrics([]) == (None, None, None)
output: def calculate_metrics(sequence):
      if not sequence:
          return None, None, None
      maximum = max(sequence)
      minimum = min(sequence)
      average = sum(sequence) / len(sequence)
      return maximum, minimum, average