matrix = [[2,1,7],[9,3,8],[5,3,1], [5,6,8]] for vektor in matrix: count = 0 for num in vektor: print(num, end=' ') count += 1 if count == 3: print()