Question: write a program to host a game of Three Questions. This game plays just like its big sibling, 20 Questions, but with a key (shocking!)

write a program to host a game of "Three Questions." This game plays just like its big sibling, "20 Questions," but with a key (shocking!) difference: 17 fewer questions.

Write a function called "play_game" that will use "prompt", "confirm", and/or "alert" to interact with the user and ask its questions

The game starts with the computer telling the human player to think of an item. The program will then ask a series of yes-or-no questions, culminating with a guess about what item the player has in mind. The series of questions should always make sense. If the player says their item is not alive, the program shouldn't follow up by asking if it's a mammal. Here's how the game might proceed:

Is it alive? > Yes

Is it an animal? > No

Is it broccoli? > Yes

Computer wins!

Is it alive? >

No Is it metal? >

Yes Is it a red 1966 Ford Mustang? > No

Computer loses...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!