3. Make a list


#1



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

There are no error messages, it says my answer is right but it isn't.


board = []
for i in range(5):
    board.append(5 * ["O"])
for x in board:
    for y in x:
        print y


Instead of printing the 5 by 5 "O", it printed this:

O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
None

#2

Well if you look at your code, it says to print each individual location on a line of its own. If you want it to do something else, then in what way would you need to change that?


#3

Please remove
'for y in x:' before the 'print y'. But leave the 'print y' as is under the 'for x in board:' loop. Hope this helps!


#4

This works, there's no need to print the O's
board=[]
for n in range(5):
board.append(['O']*5)


#5

so like this?

board = []
for i in range(5):
    board.append(5 * ["O"])
for x in board:
    print x
print board

Thanks!


#6

Almost just don't need to print board at the end

board = []
for i in range(5):
    board.append(5 * ["O"])
for x in board:
    print x
-----------------------------------------
Output:
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
None

#7

Is not n here used as a placeholder element as well as a looping variable that needs to be replaced with the actual character of 'O'?