Custom Print, right code but wrong answer


#1



Battleship 5. Custom print


It says the code did not print the correct response.


Replace this line with your code. 
board = []
for number in range(0,5):
    number = ["O"]
    board.append(number)
def print_board(board):
    for row in board:
        print board
print_board(board)


#2

this line should be inside your for loop,

i.e..

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

#3

Yup that worked thanks!


#4

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