Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

print a formatted table using python

d = [ ["Mark", 12, 95],
     ["Jay", 11, 88],
     ["Jack", 14, 90]]
     
print ("{:<8} {:<15} {:<10}".format('Name','Age','Percent'))

for v in d:
    name, age, perc = v
    print ("{:<8} {:<15} {:<10}".format( name, age, perc))
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #print #formatted #table #python
ADD COMMENT
Topic
Name
9+4 =