I am getting really confused about the logic behind the below function, specifically how this for loop works and how the if condition work, can anyone please elaborate further and what is the meaning of "if and not" ?
def parse_grid(grid):
values = dict((s, digits) for s in boxes)
for s,d in grid_values(grid).items():
if d in digits and not assign(values, s, d):
return False
return values
Reference: this is part of Peter Norwig sudoku solver code.
Aucun commentaire:
Enregistrer un commentaire