Timeline for Deepcopy usage in a Sudoku solver
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 23, 2017 at 12:40 | history | edited | Community Bot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Apr 1, 2014 at 14:02 | comment | added | SylvainD |
This is going out of my field of knowledge but I reckon using the same variable name for nested loop is not a real issue with for loops (in the sense that it will perform the number of iteration you'd expect). You can reuse underscore everywhere and it should work : len([0 for _ in range(10) for _ in range(10)]) == 100 . I am not sure what the usage is in that case.
|
|
Apr 1, 2014 at 13:41 | comment | added | flakes | Hmm.. that underscore notation is pretty neat! What would be the convention for a nested loop with another don't-care? Double underscore? | |
Apr 1, 2014 at 8:27 | comment | added | SylvainD | No good reason : I have updated my answer. | |
Apr 1, 2014 at 8:27 | history | edited | SylvainD | CC BY-SA 3.0 |
Removed useless values
|
Mar 31, 2014 at 22:19 | comment | added | wchargin |
Is there a reason for using range(0,10) instead of range(10) ?
|
|
Mar 31, 2014 at 17:51 | comment | added | Underdetermined | I'm am overwhelmed by the thoroughness of your answer. Thank you. Inefficiencies in the declarations was one thing I worried about. I will try to implement these in the coming week. | |
Mar 31, 2014 at 15:56 | history | edited | SylvainD | CC BY-SA 3.0 |
added 56 characters in body
|
Mar 31, 2014 at 15:39 | comment | added | Bakuriu |
And self.values = {n:True for n in range(0,10)} becomes: self.values = dict.fromkeys(range(0,10), True) . You can also drop the [ and ] in the join call and avoid building a useless list .
|
|
Mar 31, 2014 at 13:44 | history | edited | SylvainD | CC BY-SA 3.0 |
added 565 characters in body
|
Mar 31, 2014 at 13:39 | history | answered | SylvainD | CC BY-SA 3.0 |