code: def display_table(headers, table):
      
      assert all(len(row) == len(headers) for row in table)
  
      str_headers = [str(header) for header in headers]
      str_table = [[str(cell) for cell in row] for row in table]
      column_lengths = [
          max(len(header), *(len(row[i]) for row in str_table))
          for i, header in enumerate(str_headers)
      ]
  
      print(
          " | ".join(
              str(header).ljust(length)
              for header, length in zip(str_headers, column_lengths)
          )
      )
      print("-+-".join("-" * length for length in column_lengths))
      for row in str_table:
          print(
              " | ".join(
                  str(cell).ljust(length)
                  for cell, length in zip(row, column_lengths)
              )
          )
docs: Print a formatted table.
  
      :param headers: A list of header objects that are displayed in the first
          row of the table.
      :param table: A list of lists where each sublist is a row of the table.
          The number of elements in each row should be equal to the number of
          headers.