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