Project- Game of Tic Tac Toe with Python

14 / 16

Tic Tac Toe with Python - Congratulate the winner

Here, we will write a function called congrat_winner which does exactly that, it congratulates the player who won the game.

INSTRUCTIONS
  • Write the function congrat_winner as shown below:

    def <<your code goes here>>(the_winner, computer, human):
        if the_winner != TIE:
            print(the_winner, "won!\n")
        else:
            print("It's a tie!\n")
    
        if the_winner == computer:
            print("Well, I won this round.  \n"
                  "Better luck next time.")
    
        elif the_winner == human:
            print("You know what they say. \n"
                  "Winner Winner Chicken Dinner!")
    
        elif the_winner == TIE:
            print("It's a TIE. \n"
                  "Better luck next time.")
    
See Answer

No hints are availble for this assesment


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

Loading comments...