Custom Print


Could you please explain why my code is working?

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

def print_board(board):
    for i in range(len(board),4):
        print board[i]

And if I click "Save and Submit" the black board on the right just Shows "None" instead of showing me my board.


This is a little off.

It should be a range from 0 to len(board).


Check this thread out,

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

The above code worked for me. Printing (board) will print the entire board.