5 - Custom Print


#1

Hi!
For the 5th question i did
def print_board(board):
for row in board:
print " ".join(row)

but i have and error that says "Oops, try again. It looks like you function didn't print out the correct response!"
Can you help me please? :smile:


#2

Hey, you've got the right idea. Unfortunately, your answer is a bit too advanced for the current test. The output you should get is each nested list on it's own line:

['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'X', 'O']
None

You're solving more than this lesson wants you to, which is awesome in every way except making the error checking happy!

Dumb down your code a bit, like this:

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

With that, you should be fine. You'll use that .join configuration VERY soon though!