7 Hide, row bounds are not correct



Oops, try again. It looks like your row bounds are not correct.

i have looked and looked at this code and don't know where it's getting messed up. will someone take a look and tell 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):
    randint(0, len(board) - 1)
def random_col(board):
    randint(0, len(board) - 1)

print print_board(board)

i don't know if it's the row in def print_board or the random_row code that is getting this messed up.


figured it out.

was looking over the return statement from others code.

wasn't seeing that i didn't have it in mine.

return randint(0, len(board) - 1) on both counts.


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