Hide


#1

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)
random_row(board)

def random_col(board):
randint(0, len(board)-1)
random_col(board)

"""my code, nd error:

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

Can you help me?


Hide
#2

Although I can't see your code's indentation, your error would be your missing the return keyword. I've corrected,as below:

# Add your code below!
def random_row(board):
    return randint(0, len(board) -1)
random_row(board)

def random_col(board):
    return randint(0, len(board) -1)
random_col(board)

Hope this helps! :slight_smile:


#3

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