5. Custom Print


#1

https://www.codecademy.com/courses/python-beginner-en-4XuFm/0/5?curriculum_id=4f89dab3d788890003000096

Hi, I'm stuck in this activity.
Here is my code to print 25 O s on the console window:

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

and it printed this on the console:

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

I think this is correct, but there was an error that says 'It looks like you function didn't print out the correct response! '

What is happening? And how can I correct my code?


#2

this is the code for printing pretty? Which is the next exercise. just print row, i know that looks ugly, but doing too much already can trick an error message


#3

I just took this code from one of discussion...
I looked through my code, and I got it. Thank you @stetim94!


#4

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