Closed nuburgeri closed 2 years ago
Koodi:
def kopioi_ja_lisaa(sudoku: list, rivi: int, sarake: int, luku: int): kopio = [] kopio[:] = sudoku kopio[rivi][sarake] = luku return kopio
Aiheuttaa virheen:
s = [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 5, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ] vast = kopioi_ja_lisaa(s, 1, 1, 5) palauttaman matriisin vast rivin 1 pitäisi edelleen olla: [0, 0, 0, 0, 0, 0, 0, 0, 0]: se kuitenkin muuttunut muotoon: [0, 5, 0, 0, 0, 0, 0, 0, 0]
Jo parametrina annetun sudokun rivi 1 on 0,5,0,...
Koodi:
Aiheuttaa virheen:
Jo parametrina annetun sudokun rivi 1 on 0,5,0,...