Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python assignment if any question post below Three Card Monte Create a program that allows the user to play the game Three Card Monte, where

Python assignment if any question post below image text in transcribed
image text in transcribed
Three Card Monte Create a program that allows the user to play the game Three Card Monte, where a player bets that they can guess the location of the queen in a set of three cards. The user should start the game with $100. Hide the queen in one of three places by randomixing its location with a value between 1 and 3. Prompt the user to enter an amount to bet (check that the user has enough money, otherwise tell them that it is invalid). Then prompt the user to enter their guess for where the queen is hidden (check that the entered value is between I and 3 ). If it is a match, then the user receives double their bet. Display the location of the queen and tell the user if they were correct of not. Repeat the game until the user runs out of money or decides to quit. Notes: 1. Place your name, date, and a brief description in a comment block at the top of your program. 2. Your code should be defined in a main function. 3. Use the check_input module provided on Canvas to check the user's input for invalid values. Add the py file to your project folder to use the functions. You may modify it as needed. Examples using the module is provided in a reference document on Canvas. 4. Use the random module to generate your random numbers. Examples for generating random numbers is provided in a reference document on Canvas. 5. No need to create extra functions or add lists to your code, you'll only need the main function with a while loop and some if statements. 6. Please read through the Coding Standards reference document on Canvas for guidelines on how to name your variables and to format your program. 7. Add brief comments in your program to describe sections of code (you should not have a comment describing every single line). 8. Thoroughly test your program before submitting: a. Make sure the game re-randomizes the location of the queen every round. b. Make sure that the user cannot enter an invalid input for the bet or the guess. c. Make sure that the queen is displayed at the correct location. d. Make sure that the game accurately reports whether the user chose the correct location of the queen. e. Make sure that the user gains the amount of the bet when they win and takes away the amount of the bet when they lose. f. Make sure the game ends when the user is out of money or when the user decides to quit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions