2024-10-01 19:29:44 发布
网友
TypeError: 'int' object is not subscriptable
代码:
def calcPossibleMoves(grid): possibleMoves = [] for x in range(9): if grid[x] == 0: possibleMoves.append(x) return possibleMoves
你的问题是grid参数;您使用订阅的唯一地方是在执行grid[x]时,因此问题出在没有显示的代码中;调用函数并提供int而不是某种序列的代码
grid
grid[x]
int
你的问题是
grid
参数;您使用订阅的唯一地方是在执行grid[x]
时,因此问题出在没有显示的代码中;调用函数并提供int
而不是某种序列的代码相关问题 更多 >
编程相关推荐