7/19 - raindint is not defined


#1

typing in this 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_in):
return randint(0, len(board_in) - 1)

def random_col(board_in):
return raindint(0, len(board_in) - 1)

random_row(board)
random_col(board)

and then it gives me this error:
Traceback (most recent call last):
File “python”, line 21, in
File “python”, line 18, in random_col
NameError: global name ‘raindint’ is not defined


#2

check your spelling/check for typos


#3

oh right, shouldn’t do coding at night


#4

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