Project- Game of Tic Tac Toe with Python

You are currently auditing this course.
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

Loading comments...