input: Write a function to calculate the maximum, minimum, and average values from a given sequence of numbers. If the sequence is empty, return None for all values.
  def calculate_metrics(sequence):
      if not sequence:
          return None, None, None
      
      maximum = max(sequence)
      minimum = min(sequence)
      
      n = len(sequence)
      total = sum(sequence)
      average = total / n
      
      return maximum, minimum, average
  
  assert calculate_metrics([3, 4, 5, 6, 21, 8]) == (21, 3, 8.166666666666666)
  assert calculate_metrics([10, 20, 30, 40, 50]) == (50, 10, 30.0)
  assert calculate_metrics([]) == (None, None, None)
  assert calculate_metrics([7]) == (7, 7, 7.0)
  assert calculate_metrics([-5, 0, 5, 10]) == (10, -5, 2.5)
output: def calculate_metrics(sequence):
      if not sequence:
          return None, None, None
      
      maximum = max(sequence)
      minimum = min(sequence)
      
      n = len(sequence)
      total = sum(sequence)
      average = total / n
      
      return maximum, minimum, average