0
if select == (board[0] and board[1] and board[2]):
        print ("game ended - you win!")
        game = False

please see code above, when board 0 and 1 is entered by itself. It is fine. However if two is entered by itself without any other key it triggers the code below. I want the function, once all paramaters are the same then it will print the below. If you could help I'd really appreciate it

rdas
  • 20,604
  • 6
  • 33
  • 46

1 Answers1

3

Are you looking for something like this?

if select == board[0] == board[1] == board[2]:
    print("game ended - you win!")
    game = False
BrownieInMotion
  • 1,162
  • 6
  • 11
  • What if board has four elements? Five elements? Six elements? (See where I’m going with this ... ?) – S3DEV Nov 05 '21 at 20:35