input: Write a function to calculate the maximum, minimum, and average values from a given sequence of numbers. The function should take a list as input and return the maximum, minimum, and average values as a tuple. If the list is empty, it should return (None, None, None).
  def calculate_metrics(list):
      if not list:
          return None, None, None
      maximum = max(list)
      minimum = min(list)
      total = sum(list)
      average = total / len(list)
      return maximum, minimum, average
      
  assert calculate_metrics([3, 4, 5, 6, 21, 8])==(21, 3, 7.833333333333333)
  assert calculate_metrics([10, 15, 20])==(20, 10, 15.0)
  assert calculate_metrics([])==(None, None, None)
output: def calculate_metrics(list):
      if not list:
          return None, None, None
      maximum = max(list)
      minimum = min(list)
      total = sum(list)
      average = total / len(list)
      return maximum, minimum, average