Skip to content

Latest commit

 

History

History

table_printer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Table Printer

Write a function named build_table() that takes a list of lists of strings and formats it in a well-organized table with each column right-justified. Assume that all the inner lists will contain the same number of strings. For example, the value could look like this:

tableData = [['apples', 'oranges', 'cherries', 'banana'],
             ['Alice', 'Bob', 'Carol', 'David'],
             ['dogs', 'cats', 'moose', 'goose']]

Your build_table() function would generate the following:

  apples Alice  dogs
 oranges   Bob  cats
cherries Carol moose
  banana David goose

Sample Output

sample