I used a generator to create a 10 by 10 of 'O's:
board = []
for x in range(0, 10):
board.append(["O"] * 10)
def board_generator(layout):
for y in layout:
yield (" ".join(y))
my_board = board_generator(board)
Then I set imputed the result into a variable, but when I tried outputting it to another source, I got this:
<generator object board_generator at 0x0135AAF0>
I tried to get the printed result I wanted by doing this:
def print_board(boards):
for i in boards:
print(i)
However, I could not place impute this into a variable because it does not return anything, therefore I could not output it to a text file. How do I fix this?