Battleship: Printing Pretty


#1

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


#2

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


#3

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


#4

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