相关文章推荐
想发财的滑板  ·  mysql ...·  2 年前    · 
空虚的枕头  ·  Emotet Loader分析 - 墨天轮·  2 年前    · 
爱听歌的领带  ·  MediaRecorder.SetVideo ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I tried to create an else statement that will check if there is a tie in the TicTacToe board:

#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:

Python gave said that there's a problem with this line:

if all(not(i in board):

This is the error:

E0001:invalid syntax (<string>, line 156)

How to fix the line?

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.