Last updated 8 months ago
We can use tabulate module in Python to print pretty tabular format data.
tabulate
>>> from tabulate import tabulate >>> header = ["Name", "Age"] >>> data = [["Michael", 35], ["John", 23], ["Harley", 25]] >>> print(tabulate(data, headers=header)) Name Age ------- ----- Michael 35 John 23 Harley 25
Source: