7/13 its trolling me!?!?


#1

it wont let me go further through sheer trollege he is my code:

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

and it keeps saying
"Oops, try again. did you create a function called random_row?"
:rage: :rage: :rage:
even though its clearly right there help me


#2

Hi there! (@soulfan)
My code was as follows and passes the task:

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

The reason your code isn't working is due to a spelling error, you put 'randit' as opposed to the correct 'randint'.

Moreover, you don't need the last two lines.

Hope this helps,

~NocturnalDweller~


#3

facepalm thanks Nocturnal


#4

Add your code below!

def random_row(board):
row = randint(0, len(board) - 1)
return row
def random_col(board):
col = randint(0, len(board) - 1)
return col

random_row(board)
random_col(board)