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:
[(0,0,0),(0,0,1),(0,1,0)]
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:
print(*line)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With