Make a List


board = []
for i in range(0,5):
def print_board(board):
    for i in board:
        print " ".join(i)
print print_board(board)   

what is wrong with my code?
it says :-Oops, try again. It looks like your board contains characters other than "O".


board = []
for i in range(5):
print board

try this , you dont need to use to join method yet...



Here is a copy of what I've managed to get running locally.

board = []

for i in range(0,5):
* board.append(["O"]5)**


def print_board(board):
** for row in board:**
** print(' '.join(row))**


the difference, from what I can tell is that the code above doesn't try to print the function when it's called. The function already has the print command.


you have used Zero instead of capital 'O'


I made this way and it worked:

board = []
for i in range(0,5):


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