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:

  1. If the sum of the two dice is 7 or 11, you win the bet!

  2. If the sum of the two dice is 2, 3, or 12, you lose. :(

  3. 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:

  1. How much money they ended up with

  2. How many rounds were wins, losses, and draws

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!