rows = 3 cols = 2 matrix = [ [1, 2], [3, 4], [5, 6] ] for i in range(rows): for j in range(cols): print(matrix[i][j], end=' ') print()