# 2d array a[row][col] , swap the columns h and k for i in range(row): a[i][k] , a[i][h] = a[i][h], a[i][k]