Printing Pretty


#1



Battleship! Printing Pretty


I am not getting an error message but, the 5x5 matrix of "O" is not displaying.


Replace this line with your code. 
board=[]
for i in range(0,5):
    board.append(5*["O"])
    

def print_board(board):
    for row in board:
        print board[row]
        print " ".join(row)
        print"---".join(row)
    return board


#2

That line can be removed.

No need to return anything. Just print.

Not asked for or expected.

def print_board(board):
    for row in board:
        print " ".join(row)

should be enough for the purposes of this exercise.


#3

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