If you’re getting an error message that says something along the lines of Oops, try again! It looks like the rows are not represented as lists., it’s likely because you’ve tried to .append() the character "O" by itself, not as a list.
In the example we see that print ["O"] * 5 results in a single list containing 5 "O"s. This is exactly what we want to be .append()ing to our board inside of the for loop.
If we forget to put brackets around the "O", it ends up just adding 5 strings with 5 "O"s each, like this: ['OOOOO', 'OOOOO', 'OOOOO', 'OOOOO', 'OOOOO']
This exercise was confusing, in part because it isn’t clearly stated what form the result is expected to take.
The exercise is intended to build a list with five items in it. Each of those items is another, nested list, where the letter O is repeated five times per sub-list:
board = []
for printingboard in range(5):
board.append(["OOOOO"])
print board
And ends up with this:
[[‘OOOOO’]]
[[‘OOOOO’], [‘OOOOO’]]
[[‘OOOOO’], [‘OOOOO’], [‘OOOOO’]]
[[‘OOOOO’], [‘OOOOO’], [‘OOOOO’], [‘OOOOO’]]
[[‘OOOOO’], [‘OOOOO’], [‘OOOOO’], [‘OOOOO’], [‘OOOOO’]]
And says that not every row has 5 columns. ???