Printing pretty


#1



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

I'm allowed to the next lesson yet my board looks wrong.
I get this:
[['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']]

What do you expect to happen instead?
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


 board = []

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

        
print board


#2

print_board is a function, to execute a function, you need to call the function

now you print board directly, that looks ugly indeed


#3

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