matrix = [[-1,0,1,5],
[2,5,22,5],
[-6,2,5,3],
[7,2,3,-5]]
print(matrix)
N = 4
for i in range(N):
c = matrix[i][2]
matrix[i][2] = matrix[i][4]
matrix[i][4] = c
print(matrix)
matrix[i][2] = matrix[i][4]
IndexError: list index out of range
IndexError: list index out of range:
for i in range(N):
c = matrix[i][2]
matrix[i][2] = matrix[i][4] // выход за пределы массива
matrix[i][4] = c // выход за пределы массива