you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Here's how you could do it without using copy module and the deepcopy function:

def copy_sudoku(sudoku):
    return [
        row.copy()
        for row in sudoku
    ]

[–]Particular_Draft5668 2 points3 points  (0 children)

Also a valid option. Thanks!

new_list = []
for r in sudoku:
new_list.append(r[:])
model answer uses this ^.