Closed bitscott1102 closed 4 years ago
When fixing this make sure you run the code and make sure
I'm kinda confused on what the problem is for this one because when I used the sample grid (grid = [[9,4,0,0,2,0,7,0,0], [0,0,1,0,0,4,0,0,9], [0,0,6,0,0,0,1,2,0], [0,0,0,0,0,3,0,1,0],[1,0,0,0,0,0,0,0,8], [0,7,0,5,0,0,0,0,0], [0,8,7,0,0,0,2,0,0], [6,0,0,9,0,0,3,0,0], [0,0,9,0,8,0,0,5,7]]) that was defined in the first hard card, calling the printGrid() function prints the grid out correctly with the correct format. Each "" indicates the zeroes in the empty space for the grid that we're supposed to fill in. Whenever I change the if statement for the 2nd for loop in the code to a different number (if element == 0: rowString += " ") it leaves in all of the zeroes and replaces the number based on what value I set element equal to.
if row_index % 3 == 0 and row_index != 0: print("------|-------|-------")
if index % 3 == 0 and index != 0: rowString += "| "