I did manage changing both lines in my table, but the issue is the colums , look:
def changeLines(c,d): a = [[1, 2, 3, 4, 5, 6, 7, 8, 9], [4, 5, 6, 7, 8, 9, 1, 2, 3], [7, 8, 9, 1, 2, 3, 4, 5, 6], [2, 3, 1, 5, 6, 4, 8, 9, 7], [5, 6, 4, 8, 9, 7, 2, 3, 1],[8, 9, 7, 2, 3, 1, 5, 6, 4], [3, 1, 2, 6, 4, 5, 9, 7, 8], [6, 4, 5, 9, 7, 8, 3, 1, 2], [9, 7, 8, 3, 1, 2, 6, 4, 5]] a[c],a[d]= a[d],a[c] for i in range(len(a)): for j in range(len(a[i])): print(a[i][j], end=' ') print()
Output:>>> changeLines(3,6)
1 2 3 4 5 6 7 8 9
4 5 6 7 8 9 1 2 3
7 8 9 1 2 3 4 5 6
3 1 2 6 4 5 9 7 8
5 6 4 8 9 7 2 3 1
8 9 7 2 3 1 5 6 4
2 3 1 5 6 4 8 9 7
6 4 5 9 7 8 3 1 2
9 7 8 3 1 2 6 4 5