7 Hide, row bounds are not correct


#1



https://www.codecademy.com/courses/python-beginner-en-4XuFm/0/7?curriculum_id=4f89dab3d788890003000096#


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)

random_row(board)
random_col(board)
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.
thanks
em


#2

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.


#3

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