Print the board


#1



It says:
Oops, try again. Did you remember to print your board?


[]

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

for row in board:
    print " ".join(row)      
       



#2

According to the code you posted, you did not make [] identifiable as the board. I am sure once you do that, you will be good to go.


#3

I defined [] part. I just couldn't copy it here. Here what I tried at last. To me, everything is ok.But it just says:
Oops, try again. Did you remember to print your board?
However I didn't. I copied the below code from this forum.And everybody did it: like the way I did.Here is the code:
................................
board = []

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

def print_board(board):
for row in board:
print " ".join(row)

print_board(board)
...............................................

I watced for indentations and everything seem ok.
Thanks in advance for your help :slight_smile:

Indentations are not visible in here but I did every indentation right.


#4

When I copy and paste your code in to the editor, and set the indentation correctly, everything works as it should. Try using the < / > button at the top of the forum message editor and place the code in there so I can see what you are seeing.


#5

board = []

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

def print_board(board):
    for row in board:
        print " ".join(row)
        
print_board(board)

here is my code. As I said I copied it from the forum and I wrote as how everybody wrote. Unfortunately I can't pass the step to continue as you know.I feel stuck and it began to become annoying. Nothing seems wrong.
Thank you for your advices.


#6

When I copy and paste this code in to the lesson it works. So, I am unable to reproduce the problem.

The only suggestion I can give is to copy the code, reset the lesson, then paste it.


#7

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