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