This python script will solve sudoku puzzles.
Input is given as a nested list consisting of 9 lists which contain the initial values of the puzzle and zero for empty values.
For Eg.
puzzle = [[5,3,0,0,7,0,0,0,0],
[6,0,0,1,9,5,0,0,0],
[0,9,8,0,0,0,0,6,0],
[8,0,0,0,6,0,0,0,3],
[4,0,0,8,0,3,0,0,1],
[7,0,0,0,2,0,0,0,6],
[0,6,0,0,0,0,2,8,0],
[0,0,0,4,1,9,0,0,5],
[0,0,0,0,8,0,0,7,9]]
You can change the input puzzle at the top of the file sudoku.py
Output is printed to the console.
$ git clone https://github.com/itzmidinesh/sudoku-solver-python.git
$ cd sudoku-solver-python
$ python sudoku.py