3/19 This code prints what's asked but I still get an error


#1

Code

for x in range(0,5):
print['O']*5

which prints
['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']

That's what I thought we're being asked to do, and it looks right, but why am I getting the error: "it looks like you do not have 5 rows in your list."

Thanks for any clarity.


#2

Here are my code hope can help you

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

`


#3

Does this work for you?

I have the same code:

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

But I still get this error:
"Oops, try again. It looks like you do not have 5 rows in your list."


#4

@terapro38605 Those are columns, not rows. You must do another for inside your for. It is telling you to give him a bidimensional array of 5x5.


#5

Thanks for the coomment, however, I fixed it.
I had tried a second embedded loop, but that was not the answer.
The solution was that I used too many iterations. The correct code is below (range 5 instead of range 6):

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