input: Write a function to calculate the maximum, minimum, and average values from a given sequence of numbers. The function should accept one parameter which is a list of integers, and return three values: the maximum value, the minimum value, and the average value.
  def calculate_metrics(list):
      maximum = max(list)
      minimum = min(list)
      n = len(list)
      total = 0
      for num in list:
          total += num
      average = total/n
      return maximum, minimum, average
  assert calculate_metrics([3, 4, 5, 6, 21, 8])==(21, 3, 7.833333333333333)
  assert calculate_metrics([1, 2, 3, 4, 5])==(5, 1, 3.0)
  assert calculate_metrics([0, 0, 0, 0, 0])==(0, 0, 0.0)
  assert calculate_metrics([])==(None, None, None)
  assert calculate_metrics([-1, -5, -3, -2])==(-1, -5, -2.75)
output: def calculate_metrics(list):
      if not list:
          return None, None, None
      maximum = max(list)
      minimum = min(list)
      average = sum(list) / len(list)
      return maximum, minimum, average