Ok. Got it.
That’s it! Thank you! I was focusing on the output and somehow forgot to look at the bigger picture and missed the fact that I’m dealing with functions here.
Ok. Got it.
That’s it! Thank you! I was focusing on the output and somehow forgot to look at the bigger picture and missed the fact that I’m dealing with functions here.
I workshopped this one for a while. I haven’t had issue before, but found that I needed to call both random numbers as a different variable for it to read. I also did not call them in the board function and just printed them for my result. Not sure why but this is the code that ran for me.
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)
def random_row(board_in):
r = randint(0, len(board_in) - 1)
print r
return r
def random_col(board_in):
c = randint(0, len(board_in) - 1)
print c
return c