“def getBoardCopy”的语法无效

2024-05-14 00:46:20 发布

您现在位置:Python中文网/ 问答频道 /正文

def getBoardCopy(board):
    #Make a duplicate of the board list and return it the duplicate.
    dupeBoard=[]

    for i in board:
        dupeBoard.append(i)

    return dupeBoard

这只是为了设置一个复制的董事会,但我不断得到无效的语法错误,我不知道为什么。你知道吗


Tags: andoftheinboardformakereturn
1条回答
网友
1楼 · 发布于 2024-05-14 00:46:20

这通常意味着你行上面的语法是错误的。你知道吗

查看前面的行,查找缺少的括号、冒号、方括号、引号,以及任何可能导致表达式打开的内容。你知道吗

您可能在前一行中漏掉了冒号:

(bo[9] == le and bo[5] == le and bo[1] == le)

你应该这样写:

(bo[9] == le and bo[5] == le and bo[1] == le))

相关问题 更多 >