Help! custom print error


def print_board(board): 
    for y in board:     
        print board

[['O'], ['O'], ['O'], ['O'], ['O']]
[['O'], ['O'], ['O'], ['O'], ['O']]
[['O'], ['O'], ['O'], ['O'], ['O']]
[['O'], ['O'], ['O'], ['O'], ['O']]
[['O'], ['O'], ['O'], ['O'], ['O']]

it said it was not the correct response


You need to print each row, not the the board.


You are suppose to make it a string and join each row with the .join() method. Right now your for loop is just spewing back what you gave it unformatted becuase you put a simply print board statement.


was the .join() method touched on earlier in the tutorial? or are there text books or other resources that you are using to find these methods? thank you


It was introduced in the Codecademy lessons although I can't remember which one. :confused:


Right thanks, i've been doing this in chunks and leaving it too long in between lessons. i should probably start from the beginning again to refresh. Thanks Chip!


You're welcome, and that may be a good idea. Just a heads up, the courses for Python and some other things are going to be updated in the near future, and progress will be affected, so you might want to finish quickly. Here's more on that:

Important Changes to Codecademy Courses


Thanks for the forewarning. I better get crackin, only at 50%!


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

def print_board(board):
for r in board:
print r


This worked for me. If it still needed.


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