Question: (Python) Simplified Roulette You are visiting Las Vegas. You decide that you will play a simplified version of Roulette. The game is played this way:

(Python) Simplified Roulette

You are visiting Las Vegas. You decide that you will play a simplified version of Roulette.

The game is played this way:

On a roulette wheel the pockets are numbered from 0 - 36. The colors of the pockets are as follows:

Pocket 0 is green

For pockets 1 through 10, the odd-numbered pockets are red and the even-numbered pockets are black

For pockets 11 through 18, the odd-numbered pockets are black and the even-numbered pockets are red

For pockets 19 through 28, the odd-numbered pockets are red and the even-numbered pockets are black

For pockets 29 through 36, the odd-numbered pockets are black and the even-numbered pockets are red

You select a pocket number and place your bet. The wheel is spun and a ball lands in a pocket.

If you bet on pocket 0 and the ball lands that pocket you receive 10 times the amount you bet (if you bet $1 you receive that $1 plus $9)

If the ball lands in the red or black pocket you bet on you receive triple the amount you bet (if you bet $1 you receive that $1 plus $2 ).

If the ball lands in a red or black pocket that is the same color as the pocket you selected you double your money (if you bet $1 you receive that $1 plus $1)

If the ball lands in a red or black pocket that is a different color than the red or black pocket you selected you lose your bet

You start with $500

You are to write a program that will accept from the user the pocket number they select and the amount of their bet. Your program must trap the user to enter valid information (i.e. a pocket number 0 - 36 and a bet >= 0). Simulate the landing of the ball in a pocket through the random generation of a number 0 - 36, inclusive). Your program will simulate the play of the game as described above.

Play a game until the user has no money left.

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!