Battleship 5/19 BUG?


#1

Is this a bug?

So we are told to write this function:

def print_board(board_in):
for row in board:
print row

print_board(board)

And it prints out all 5 rows without a problem…BUT, if you look at the for loop it says for row in board: …isnt it supposed to say for row in board_in: , like the argument in the function???In earlier lessons we had to use the argument in the function inside the loop too!?

With other words, shouldnt the function look like this:

def print_board(board_in):
for row in board_in:
print row

print_board(board)


#2

yes, it should. Some of the suggested solutions by codecademy are not good


#3

I knew something was wrong with their loop…I was so confused. Now I can finally continue with the lesson, thank you so much for the reply!!


#4

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