Question: If someone could please heo me finish this code it would be greatly appreciated, I have most of it done I believe I just need

 If someone could please heo me finish this code it would
be greatly appreciated, I have most of it done I believe I
just need some help finishing it. CS 1400: Yahtzee Simulation Description You
If someone could please heo me finish this code it would be greatly appreciated, I have most of it done I believe I just need some help finishing it.

CS 1400: Yahtzee Simulation Description You are playing Yahtzee with your friends when someone rolls a Yahtzee on the first roll. A Yahtzee is scored when all 5 dice have the same number. What are the chances of scoring a Yahtzee after just one roll of the dice? You could figure this out mathematically, but you decide to use your programming skills to create a simulation Simulations are valuable when the rules of a game are more complex and the mathematical solution becomes difficult to obtain Assignment Write a function called Yahtzee_Simulation) that receives no parameters. The function will simulate rolling 5 dice at least one million times It will keep track of the number of times the computer rolls a Yahtzee. The function will return the number of wins divided by the number of tries. There are no print) statements in this function Write a function called main() that receives no parameters. This function calls the Yahtzee_Simulation() function 10 times and print the result of each simulation. Finally, print the mathematical result, which can be calculated with the following code print/6/(6**5)) Hints You are not required to use the hints. It's your code . Consider breaking your code into more than the two required functions. For example, you could make a function to roll the dice Potential Sessions Sample 1 The isson runs 1000000 tis Thonny - /Users/benellsworth/CS-1400 STOD Highway.py yahtzee.py 2 # 02/11/21 Ben Ellsworth 3 import random 4 5 def rollDice(sides): 6 return random.randrange(sides)+1 7 8 def yahtzee_simulation(): 9 yahtzee=0 10 for i in range(1000000) 11 dicel=rollDice(6) 12 dice2=rollDice(6) dice3=rollDice(6) 14 dice4=rol Dice(6) 15 dice5=rollDice(6) if dicel=dice2==dice3=dice4==dice5: 17 yahtzee = yahtzee + 1 18 return yahtzee/1000000 19 20 21 22 plays yahtzee 1000000 times 13 16 23 Args: None 24 25 26 27 28 Returns: (float)prob of a yahtzee Highway.py yahtzee.py

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!