Oops, try again. Did you create a function called random_row?



I believe my current answer should be correct, but I keep getting this dumb error msg:

"Oops, try again. Did you create a function called random_row? "

This should work right? What's missing?

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 rantint(0, len(board) -1)
def random_col(board):
    return rantint(0, len(board[0]) -1)


Could you include the link to this lesson so that I can see the instructions and look at what the code should be?

Without seeing the instructions or my code, I can already tell that

needs to be
return randint(0, len(board) - 1)
with a d in randint instead of a t.
This word also needs to be changed here:

I don't know if this is your only problem though.


Thanks kyleaw! Problem solved. That's hilarious that I missed that after staring at my code 50 times...


Glad I could help! And it happens to everybody so don't worry about it. :slight_smile:


Ha ha, at least it wasn't a job interview


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