Stuck!


#1



board=[]

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

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.

I GET->Traceback (most recent call last):
  File "python", line 3, in <module>
NameError: name 'x' is not defined


#2

5(x) is not a valid range.

range(5)

Did you mean,

board.append(y)

?


#3

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