Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  Enroll Now

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.

  • Define the function next_turn as shown below:

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

No hints are availble for this assesment

Answer is not availble for this assesment

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

Loading comments...