2 ms·
Fractionally more compact: widths = [max(map(len, col)) for col in zip(*table)] print("\n".join(" | ".join(f"{r:<{w}}" for r, w in zip(row, widths)) for r
by robertlagrant 2y ago
Fractionally more compact:
widths = [max(map(len, col)) for col in zip(*table)]
print("\n".join(" | ".join(f"{r:<{w}}" for r, w in zip(row, widths)) for row in table))