Printing Pretty(Why isnt it working?)


Oops, try again. It looks like you function didn't print out the correct response!

What is wrong?

board = []

for i in range(0,5):
    board.append(["O"] * 5)
def print_board(board):
    for row in board:
        print "".join(row)

print board


Hi @ebiwonjumio ,

You have this ...

print "".join(row)

... but the instructions ask for the following output format, which has a space between each "O" character ...

"O O O O O"

Call the join method from " " instead of from "".

You also have this statement ...

print board

Why not call your print_board function instead?


Thank you! I actually figured out already!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.