5/19 Doesnt help


#1

board = []
for i in range(0,5):
a = ["O","O","O","O","O"]
board.append(a)
def print_board(board):
for i in board:
print i

print_board(board)

can any one just explain the working of each and every step and wht exactly it does?


#2

a is a constant so we should not be declaring it inside a loop.

board = []
a = ["O","O","O","O","O"]
for i in range(len(a)):
    board.append(a)
def print_board(board):
    for i in board:
        print i
print_board(board)

This can be further refined, but for now produces a square.


#3

if we print the board instead of i will we get the desired ans??


#5

How about,

    print board[i]