PRVS PRVS - 1 year ago 33
Python Question

how to print array as a table in python

I'm trying to print an array like:

Table = [(0,0,0),(0,0,1),(0,1,0)]

Therefore, I want to print this array as a table like:

0 0 0
0 0 1
0 1 0

How can I make this?

I tried a simple
print Table
but this prints the array like this:



Have you tried a basic for loop?

for line in Table:
    print ' '.join(map(str, line))

It's prettier in Python 3:

for line in Table: