3 Make a List


Totally messed up and don't know what to do.
Need some help, not complete, but right way.

"Can anyone help?" Captain Obvious?


Can I see your code and error message? What exercise is this?


This should be the exercise.



Instruction not clear enough, not quite see how to deal with it ;[
And don't want for complete answer.


Thanks :slight_smile:


You need to do a for loop. In the for loop, copy the example they've given you about the ["O"] * 5 to create 1 row. Then you need to append those to board for them to appear. The loop function will do a few more rows until you've reached the # of rows you desired (which is 5 in this problem).


Let's take this step by step. Instructions tell us:
Create a 5 x 5 grid initialized to all 'O's and store it in board.Use range() to loop 5 times.
Inside the loop, .append() a list containing 5 "O"s to board, just like in the example above.
Note that these are capital letter "O" and not zeros.

board = [] #Make an empty list board

for i in range(5): #looped with range for 5 times

Since you don't want the full answer I will let you complete the rest of the code. Now you have to .append() a list containing 5 "O"s to board inside the for loop, then print board. If you are still confused message me.


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

got all in one line, not each on separate line. Is this correct?
Got green light. "way to go" thought need to do them like 5*5 on separate lines.


Yeah, step #5 will tell you how to get them on separate lines


Thank you.
Keep going.


Yup, that's correct. Great job! :slight_smile:


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