Write a script that simulates a simple dice gambling game
Write a script that simulates a simple dice gambling game
Write a script that simulates a simple dice gambling game.
The game is played as follows: roll a six sided die. If you roll a 1, 2 or a 3, the game is over. If you roll a 4, 5, or 6, you win that many dollars ($4, $5, or $6), and then roll again. With each additional roll, you have the chance to win more money, or you might roll a game-ending 1, 2, or 3, at which time the game is over and you keep whatever winnings you have accumulated.
Use the randint function from Python’s random module to get a die roll result: randint function
Run 10,000 simulations of the game (Monte Carlo method). Print the average amount won and the largest amount won.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


