Now we can see the contents of our list, but clearly it would be easier to play the game if we could print the board out like a grid with each row on its own line.
We can use the fact that our board is a list of lists to help us do this. Let’s set up a
for loop to go through each of the elements in the outer list (each of which is a row of our board) and print them.
First, delete your existing
Then, define a function named
print_board with a single argument,
Inside the function, write a
for loop to iterates through each
Call your function with
board to make sure it works.