6. Printing pretty - didn't print out the correct response!


Can someone tell me where I am going wrong please? I am getting the error

"Oops, try again. It looks like you function didn't print out the correct response!"

board = []

def battleship(grid):
    for i in range(5):
        board.append(5 * ["O"])
    return board

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


Thanks in advance!


why do you have a battleship function (line 3)? its nowhere in the instructions

you never call the battleship function, so the function never executes, so the board is never created. Without the board existing properly, you can't print it pretty


Ah thank you so much for this!!

Not sure where battleship came from in all honesty...


i mean, its possible, bit more challenging if you like, but if you are already struggling i would advice against it, good luck! Any questions left for me?


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