I can’t figure out why it is saying my answer didn’t print out correctly?
the board should look like this:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
your board is missing a few spaces (to make it look a bit cleaner)
Ah, I realized that I needed to add a space in line 7. Thanks!
The parameter in the
print_board function header is
board_in. Therefore, you should also be using
board_in within this
for loop header instead of using
for row in board
The correction will not change the output in this case, but in general, a function should access its parameters rather than access global variables directly, when the intent is to pass the global variable to the function as an argument, as is done here …
Subsequent to that function call,
board_in refers to the global
board object as the function executes. So, use the
board_in variable within the function.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.