Question
with PYTHON create simulation that is going to be just for the first round of craps, during which you make a bet and roll two
with PYTHON create simulation that is going to be just for the first round of craps, during which you make a bet and roll two six-sided dice, whereupon:
-
If the sum of the two dice is 7 or 11, you win the bet!
-
If the sum of the two dice is 2, 3, or 12, you lose. :(
-
If the sum is anything else, you dont gain or lose any money.
Write a simulation to play this first round of craps over and over until either (1) you run out of money, or (2) you double your money. Start with $100, and randomly choose an amount to bet on each round from $5 to $20; the bet will stay consistent throughout the entire simulation.
Over and over again, roll two dice using random.randint, and determine whether you win (add the bet amount to your total), lose (subtract the bet amount from your total), or draw. Play until one of the two stopping conditions occurs, and then report back to the user:
-
How much money they ended up with
-
How many rounds were wins, losses, and draws
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started