forked from BiresashisDas/Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7b0343
commit 8d7d9b2
Showing
1 changed file
with
9 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
# Author :- Biresashis Das | ||
|
||
|
||
# Here we will see how to create a Table using prettytable module | ||
|
||
from prettytable import PrettyTable | ||
table = PrettyTable() | ||
table.add_column("CAR BRAND", ["TATA", "TESLA", "JAGUAR",]) | ||
table.add_column("OWNER NAME", ["SIR RATAN TATA", "ELON MUSK", "SIR RATAN TATA",]) | ||
table.add_column("CAR BRAND", ["TATA", "MAHINDRA XUV700", "JAGUAR",]) | ||
table.add_column("OWNER NAME", ["SIR RATAN TATA", "Mr. ANAND MAHINDRA", "SIR RATAN TATA",]) | ||
table.align = "l" | ||
print(table) | ||
|
||
|
||
# It will show the given output | ||
|
||
# +-----------+----------------+ | ||
# | CAR BRAND | OWNER NAME | | ||
# +-----------+----------------+ | ||
# | TATA | SIR RATAN TATA | | ||
# | TESLA | ELON MUSK | | ||
# | JAGUAR | SIR RATAN TATA | | ||
# +-----------+----------------+ | ||
|
||
# +-----------------+--------------------+ | ||
# | CAR BRAND | OWNER NAME | | ||
# +-----------------+--------------------+ | ||
# | TATA | SIR RATAN TATA | | ||
# | MAHINDRA XUV700 | Mr. ANAND MAHINDRA | | ||
# | JAGUAR | SIR RATAN TATA | | ||
# +-----------------+--------------------+ |