Question: 2 Exercise-3 Create a function to roll a dice and utilize it to develop a game of chance as described below: A player rolls iwo
2 Exercise-3 Create a function to roll a dice and utilize it to develop a game of chance as described below: A player rolls iwo dice. Each die has six faces. These faces contain 1, 2, 3, 4, 5 and 6 spots. After the dice have come to rest, the sum of the spots on the two upward faces is calculated and printed. If the sum is 7 or 11 on the first throw, the player wins and the game is over If the sum is 2, 3 or 12 on the first throw (called "craps"), the player loses (ie, the "house" wins) and the game is over. If the sum is 4, 5, 6, 8, 9 or 10 on the first throw, then that sum becomes the player's "pointand the game continues until the player wins or loses. To win, you must continue rolling the dice until you make your point", ie, the sum is identical to your point in the first throw. The player ioses by rolling a 7 before making the point. Note: utilize function random.randrange to create a function to roll a dice. [1: # demonstration on how to use the randon.randrage funtion Import random die1 = random.randrangel 1, 7) die2 = random.randrange 1, 7) 1: Mode: Command int Colt Labod yn Saving completed elv 4 MacBook Pro
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
