Battleship: Printing Pretty


Bonjour, all.

This is the "Printing Pretty" task.

Error message: "Oops, try again. It looks like you(sic) function didn't print out the correct response!"

What have I done?

Code as follows:

board = []
for i in range(5):
    board.append(["O"] * 5)
def print_board(board):
    for row in board:
        print "".join(row)
print board


print board should be on the same indentation level as your for loop :slight_smile:


this line:

print "".join(row)

there should be a space between the O's, so a space between the quotation marks is required to join the lists item with a space into a string

then call print_board and pass board as argument


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