Hide


#1


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

Get the error message "Oops, try again. Did you create a function called random_row?"

Have I not defined the random_row properly?

Thanks!


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 randit(0, len(board[0]) - 1)
random_row(board)

def random_col(board):
    return randit(0, len(board[0]) - 1)
random_row(board)


#2

Hi there!
So, you've got this:

import randint

and, you got:

return randit(0, len(board[0]) - 1)

Do you see where you made a silly mistake?


#3

Ahh oops! Thanks for your help!


#4

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