I don't really understand the instructions:

Define two new functions, random_row and random_col, that each take board as input.
These functions should return a random row index and a random column index from your board, respectively. Use randint(0, len(board) - 1).
Call each function on board.

and with my code, it told me I did not create a random_row function.

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


you misspelled randint


A post was split to a new topic: Hide


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