Awesome. I mean duplicating the sixth column of level 18.
def duplicate_column(matrix, column_index, duplication_number): if not matrix or column_index < 0 or column_index >= len(matrix[0]): return matrix new_matrix = [] for row in matrix: new_row = row[:column_index + 1] + [row[column_index]] * duplication_number + row[column_index + 1:] new_matrix.append(new_row) return new_matrix
Awesome. I mean duplicating the sixth column of level 18.