This is my code for Battleship problem, the error is " it looks like you function did not print the correct response!"


#1



board = [ ]

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

def print_board(board):
    for row in board:
        print " ".join(row)
        
print "Let's play Battleship!"
print_board(board)


#2

Hi, @alish0103,

For which Battleship! exercise did you submit this code?

Your code works correctly for Printing Pretty.

For the previous exercise, which is Custom Print, you need this ...

print row

instead of this ...

print " ".join(row)

#3

It worked, thanks a lot. :slight_smile:


#4

No problem; enjoy the exercises :smile:


#5