I am making a Sudoku solver in Python, and my code works, but I need to specify a list consisting of 9 lists within a list for it to be analyzed. I am currently struggling on how to make it so that when the user is prompted for an input, they enter in 9 numbers without spaces, then do it again 8 times; each time they submit a row, the row gets converted into a list. Currently I have to manually specify the list (see example below).
b=[[2,5,9,7,1,6,4,8,3],
[8,6,7,3,4,5,9,1,2],
[4,1,3,9,2,8,6,7,5],
[3,9,8,5,7,4,1,2,6],
[5,4,6,2,8,1,7,3,9],
[1,7,2,6,3,9,5,4,8],
[9,8,4,1,6,3,2,5,7],
[6,2,1,8,5,7,3,9,4],
[7,3,5,4,9,2,8,6,1]]
I was thinking of doing a while loop with a split function and then appending each value into a list, but that just creates one giant list.
Can someone help me?
I can expand on this or give you code if necessary, thanks.