0
这段代码来自我制作的tic tac toe游戏。我必须将一个值插入列表中的子列表中。这是我的尝试,但它不起作用(Python 3.5.1)。是否可以使用insert()
将值插入子列表中,如果是这样,您如何执行此操作?将值插入列表中的子列表。 PYTHON
game_board_lst = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
play1_row = int(input("Player 1: What row? "))
play1_col = int(input("Player 1: What column? "))
game_board_lst.insert((play1_row - 1)(play1_col - 1), 1)