Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left

  Apply Now

Project- Game of Tic Tac Toe with Python

13 / 16

Tic Tac Toe with Python - Time to switch turns

Next we will write a function called next_turn which simply switches controls. If the human player had moved, it will switch the turn to the AI, and vice versa.

INSTRUCTIONS
  • Define the function next_turn as shown below:

    def <<your code goes here>>(turn):
        if turn == X:
            return O
        else:
            return X
    
See Answer

No hints are availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...