I want to print a list, for instance:
x = [ [1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]]
in a certain pattern like below:
1 2 3
4 5 6
7 8 9
10 11 12
but I wasn’t able to figure it out.
In Java, I know that a simple nested for-loop can do the job but that’s not happening in Python. I tried to learn python from python programming tutorial:
for i in range(0, 4):
for j in range(0, 3):
print(x[i][j])
But the above code is just printing each number in a new line.