Simple Way to display Tabular data in Python

Here below is a simple program to display data (list or list of dictionaries) in a tabular format using the “tabulate” package.

This is the required output:

Prerequisites:

If you don’t have the “tabulate” package installed, you can install it using:

pip install tabulate

The Program:

Following is the program code:

Sample Run:

Following is a sample run of the above program:

Thanks
Ahmed

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s