Question : table python
Answered by : obnoxious-orangutan-6r5zvtoaybx7
pip install tabulate
Source : | Last Update : Fri, 16 Oct 20
Question : python table code
Answered by : jethy11
product = "Product"
item = "Quantity"
cost = "Cost"
print("%-15s %-15s %s" % (product,item,cost))
product = "Cookies"
item = "23"
cost = "$2.52"
print("%-15s %-15s %s" % (product,item,cost))
product = "Phones"
item = "2"
cost = "$322.52"
print("%-15s %-15s %s" % (product,item,cost))
product = "Cheese"
item = "5"
cost = "$6.99"
print("%-15s %-15s %s" % (product,item,cost))
#the -15 means 15 space from the first letter of the string
Source : | Last Update : Fri, 16 Sep 22