Hide please help me


from random import randint 
board = [];
for x in range(0, 5):
    board.append(["O"] * 5);
def print_board(board):
    for row in board:
        print " ".join(row)
# Add your code below!
def random_row(board):
    return randint(0,len(board) - 1)   
def random_col(board):
    return randint(0,len(board) - 1)

Traceback (most recent call last):
File "python", line 3, in
TypeError: 'str' object is not callable


Hello! Have you refreshed the page? If you haven't, refresh it again. See if that works.

Also, I have a few questions for you. Why are you using ;? Why do you also have it after the variable board =[]? I don't know if it makes a difference (it didn't when I ran it from my end), but just wondering.

Last thing, on your board.append, you used a 0. I believe previous instructions said to use a capital O.

Let me know if that helped.


just a small thing but you can also take out random_row(board) and random_col(board) out of the parentheses


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