How to print a list of lists in columns in Python

1 Answer

0 votes
list_of_lists = [[3.14, 'pi', 8], [1.78, 'width', 12], [7.67, 'height', 16]]

for col in zip(*list_of_lists):
        print(*col, sep='   ')

'''
run:

3.14   1.78   7.67
pi   width   height
8   12   16

'''

 



answered Nov 14, 2017 by avibootz
...