Printing in a new line?


#1


https://www.codecademy.com/courses/python-beginner-en-4XuFm/0/3?curriculum_id=4f89dab3d788890003000096

Hey guys, I'd like for "board" to look like this:

O 4 more Os...
O 4 more Os....
O and so on
O and so on
O and so on

Basically a 5x5 matrix of O's.

Unfortunately, I can't seem to use '\n' to break after 5 Os. It just adds the string '\n'. How do I go about fixing this?!


board = []

for i in range(0,5):
    for b in range(0,5):
        board.append('O')
    board.append('\n')
    
print board


#2

Since it's a list, you can't really use \n. They will show you how in 5. Custom Print lesson so don't worry about it for now.

Something to do with loops and printing every row in the board. :slight_smile:


#3

this exercise focuses on building the board, you will work on printing in the next two exercises


#4

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