Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

here is my program.Help my fix it from the break part. import random def rounds(num): i=0 while(i # getting number of rounds from user num

image text in transcribed

here is my program.Help my fix it from the break part.

import random def rounds(num): i=0 while(i

# getting number of rounds from user num = int(input("Enter number of rounds(2 or 6):")) if(num==2): rounds(2) # if user enters 2 rounds elif(num==6): rounds(6) # if user enters 6 rounds else: print("Please enter either 2 rounds or 6 rounds...!!!") # otherwise

The function random.randint from the random module can be used to produce an integer from a range of values. For example, random.randint(1,6) produces the values 1 to 6 with equal probability. Such a value Using this technique, write a program that will allow the user to play either two rounds or six rounds of the popular dice game known as craps. This game program must ask the user to determine whether to play A player rolls a pair of dice If the sum of dice is either 3 or 8 on the first throw, the player wins. If the sum is 2, 7 or 10 on the first throw, the player loses. Any other sum becomes the player's point" on the first throw. To win, the player must continue rolling the dice until a roll matches the point. This is termed "making the After the first throw, if the player rolls a 12 before making the point, the player loses Hint: import random used to load in the random number module for all the random functions

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago