Found a bug in lesson Battleship 5. Custom Print


The lesson said I had the correct answer. When it should have told me my answer was incorrect.

The point of this lesson is to print out the board so that each row of the board is printed to its own line. You are supposed to do this by looping through the board and printing each row. However, if you print the board it passes the test. Even though printing the board as a 2d list doesn't print out each row on its own line

board = []

for item in range(5):
    Os = ["O"] * 5
def print_board(printboard):
    for row in printboard:
        print row

print board


you should call the function if you want the function to execute which prints each row on its own line


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