Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What am I doing wrong? Can I get help to solve this in python? My code: Example Output (user input is in italics): -Three card

What am I doing wrong? Can I get help to solve this in python?

image text in transcribed

image text in transcribed

My code:

image text in transcribedimage text in transcribedimage text in transcribed

Example Output (user input is in italics): -Three card Monte- How much you wanna bet? 30 Find the queen to double your bet! You have \$100. How much you wanna bet? 50 Find the queen: 1 Find the queen: 2 +-----+ +----++ +----++ Sorry... you lose. I 1 P 1 Play again? (Y/N):y +-----+ +-----+ +-----+ How much you wanna bet? 10 Sorry... you lose. Play again? (Y/N): y You have $50. Invalid input - should be an Find the queen: 2 integer. How much you wanna bet? -1 Invalid input - should be within range 1-50. How much you wanna bet? 75 +-----+ +----o+ +-----+ Invalid input - should be You got lucky this time... within range 1-50. 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 break displayCards(cards) if cards[guessIndex] ==( Heart ) : print('You won!') print('Thanks for playing!') else: print('Sorry... you lose.') print("You're out of money." + str('Beat it loser!') )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions