Question: Python As the host, pick a door to hide the prize behind (a random number between 1 and 3). As the contestant, pick the door
Python
- As the host, pick a door to hide the prize behind (a random number between 1 and 3).
- As the contestant, pick the door that you think the prize is behind (a random number between 1 and 3).
- As the host, pick a door to reveal (a random choice from the set of door(s) that dont have the prize, and werent selected by the contestant).
- As the contestant, randomly decide if you should stay or switch (a random number between 0 and 1; only two possible values).
- If the contestant chooses to switch, they must switch to the door that wasnt revealed, and wasnt the one they originally chose
- Finally, check and record (A list of dictionaries):
- What door did the contestant choose?
- What door was the prize behind?
- What door did the host reveal?
- Did the contestant switch?
- Did the contestant win?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
