为什么在python 3中出现错误[E0001:无效语法(<;string>;)]

为什么在python 3中出现错误[E0001:无效语法(<;string>;)],python,if-statement,syntax-error,Python,If Statement,Syntax Error,我试图创建一个else语句来检查Tictatcoe板中是否存在平局: #Checking for a tie: else: #The board's numbers: for i in range(1,10): #If all or the numbers are not on the board, and no one won or lose... if all(not(i in board): #...then ther

我试图创建一个else语句来检查Tictatcoe板中是否存在平局:

#Checking for a tie:
else:
    #The board's numbers:
    for i in range(1,10):
        #If all or the numbers are not on the board, and no one won or lose...
        if all(not(i in board):
            #...then there's a tie! 
            print("Tie!")
        #If no one loses or won, and there's no tie, then the game isn't over.
        else:
            pass
Python Give说这行有一个问题:

if all(not(i in board):
这就是错误:

E0001:invalid syntax (<string>, line 156)
E0001:无效语法(,第156行)

如何修改行?

如果全部(不在板中):
更改为
如果全部(不在板中)):
如果全部(不在板中):
更改为
如果全部(不在板中)):
数一数你的括号!数一数你的括号!