Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this in python UU In the game of Lucky Seven, the player rolls a pair of dice. If the dots

Can someone help me with this in python

image text in transcribed

UU In the game of Lucky Seven, the player rolls a pair of dice. If the dots add up to 7, the player wins $4; otherwise, the player loses $1. Suppose that, to entice the gullible, a casino tells players that there are lots of ways to win: (1,6), (2,5), and so on. A little mathematical analysis reveals that there are not enough ways to win to make the game worthwhile; however, because many people's eyes glaze over at the first mention of mathematics, your challenge is to write a program that demonstrates the futility of playing the game. Your program should take as input the amount of money that the player wants to put into the pot, and play the game until the pot is empty. At the point, the program should print the number of rolls it took to break the player (25pts), as well as maximum amount of money in the pot (25pts). For this program you need to import random module to be able to generate random number. Put the following line at the beginning of your program: import random After you import random module, you can use its functions. For instance, whenever you need you can use randint() function to generate a number in a range. random.randint (1,6) Will generate random numbers from 1 to 6 including both 1 and 6. Here is a sample output: ====================Problem B===================== How much money do you want to put in? $20 ================================================== Maximum amount of money in the pot was $20.0 Total number of rolls to break the player was 20

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

Navigating The Supply Chain Maze A Comprehensive Guide To Optimize Operations And Drive Success

Authors: Michael E Kirshteyn Ph D

1st Edition

B0CPQ2RBYC, 979-8870727585

More Books

Students also viewed these Databases questions