def print_table(table):
  """Print the list of strings with evenly spaced columns."""
  # print while padding each column to the max column length
  col_lens = [0] * len(table[0])
  for row in table:
    for i, cell in enumerate(row):
      col_lens[i] = max(len(cell), col_lens[i])

  formats = ["{0:<%d}" % x for x in col_lens]
  for row in table:
    print(" ".join(formats[i].format(row[i]) for i in range(len(row))))
Print the list of strings with evenly spaced columns.
language/boolq/utils/py_utils.py