Battleship: Python coding problem - keep printing "NONE"

I am working on the custom print step of the Battleship problem from Learn Python 2

I have been able to make it work to print properly, but the last line printed is “None”. This happened to me a few times in previous exercises, but it “passes” and I can move on to the next step still. I’d like to understand why this happens I am sure I am just making a minor format error but I am struggling with figuring it out. I’d love any feedback

My input code

board = []
for i in range(0,5):

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

print print_board(board)

Thank you!

Hi, welcome to the forums!

The issue is this line:
print print_board(board)

print will print whatever you give to it, which in this case is whatever is coming back from your print_board() function.

As there is no return statement in print_board, Python returns the default value which is None. :+1: