FAQ: Learn Python - Battleship - Printing Pretty

This community-built FAQ covers the “Printing Pretty” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise Printing Pretty:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

I was able to print the rows, but my last line prints “None”. Why is that? What did I do wrong?
Here is my code:

board =

for i in range(0, 5):
board.append([“O”] * 5)

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

print print_board(board)

you didn’t indent for the for row - it should be inside the def print_board(board_in)