Let’s see the solution to the previous challenge.
def generate_grid(n_rows, n_cols): row = [0] * n_cols grid = [row[:] for _ in range(n_rows)] # 2 more possible ways of doing the same. # grid = [row.copy() for _ in range(n_rows)] # grid = [[0] * n_cols for _ in range(n_rows)] return griddef assign(grid, row, col, value): grid[row][col] = value return gridrows, cols = 9, 9sudoku = generate_grid(rows, cols)print(assign(sudoku, 1, 0, 9))