我可以在打印此列表时摆脱“无”一词吗?
from random import randint
board = []
for i in range(0,5):
board.append(["O"] * 5)
def print_board(board_in):
for x in board_in:
print (" ".join(x))
def random_row(board_in):
row = randint(0, len(board_in)-1)
return row
def random_col(board_in):
col = randint(0, len(board_in)-1)
return col
random_row(board)
random_col(board)
print (print_board(board))
现在,出现的内容是:
O O O O O
O O O O O
O O O O O
O O O O O
O O O O O
None
我如何摆脱“无”?为什么还在那里?我不明白...