Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python table code

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
 
PREVIOUS NEXT
Tagged: #python #table #code
ADD COMMENT
Topic
Name
8+5 =