Question: Write a PYTHON program (version 3.5.2) that simulates how often certain hands appear in Yahtzee. In Yahtzee, you roll five dice and then use those
Write a PYTHON program (version 3.5.2) that simulates how often certain hands appear in Yahtzee. In Yahtzee, you roll five dice and then use those dice to make certain combinations. (see picture for full description). DO NOT USE GLOBAL KEYWORD IN YOUR CODE.
q2.py has been provided: https://repl.it/EWvm/0



2. Yahtzee. Write a Python program (called q2.py) that simulates how often certain hands appear in Yahtzee. In Yahtzee, you roll five dice and then use those dice to make certain combinations. For example, the Yahtzee combination is formed by all five dice having the same value. A large straight occurs when all of the dice are in consecutive order (e.g., 1,2,3,4,5 or 2,3,4,5,6). If you haven't played Yahtzee, you can find out more from various online sources such as Wikipedia Once the five dice are rolled, the following 7 hands in Yahtzee are of interest. Yahtzee: all five dice show the same value Four of a kind (but not Yahtzee): four dice showing the same value Three of a kind (but not four of a kind, full house, or Yahtzee): three dice showing the same value Full house (but not three of a kind): three of a kind and a pair Large straight: five sequential dice Small straight (but not large straight): four sequential dice Miscellaneous: none of the above combinations Assuming the five dice are rolled n times, your program will determine the probability that each hand can be made with a single roll of the five dice. For example, if the dice were rolled four times, 3 of the rolls might be in the Miscellaneous category and one of the rolls might be a Small straight. As such, your program would report that 3 (75%) of the dice rolls were Miscellaneous and 1 (25%) of the rolls were a Small straight Directions for writing your program. a) q2.py has been provided, where roll-dice function has been written for you roll dice returns a list of 5 random integers between 1 and 6. Also, the main 2. Yahtzee. Write a Python program (called q2.py) that simulates how often certain hands appear in Yahtzee. In Yahtzee, you roll five dice and then use those dice to make certain combinations. For example, the Yahtzee combination is formed by all five dice having the same value. A large straight occurs when all of the dice are in consecutive order (e.g., 1,2,3,4,5 or 2,3,4,5,6). If you haven't played Yahtzee, you can find out more from various online sources such as Wikipedia Once the five dice are rolled, the following 7 hands in Yahtzee are of interest. Yahtzee: all five dice show the same value Four of a kind (but not Yahtzee): four dice showing the same value Three of a kind (but not four of a kind, full house, or Yahtzee): three dice showing the same value Full house (but not three of a kind): three of a kind and a pair Large straight: five sequential dice Small straight (but not large straight): four sequential dice Miscellaneous: none of the above combinations Assuming the five dice are rolled n times, your program will determine the probability that each hand can be made with a single roll of the five dice. For example, if the dice were rolled four times, 3 of the rolls might be in the Miscellaneous category and one of the rolls might be a Small straight. As such, your program would report that 3 (75%) of the dice rolls were Miscellaneous and 1 (25%) of the rolls were a Small straight Directions for writing your program. a) q2.py has been provided, where roll-dice function has been written for you roll dice returns a list of 5 random integers between 1 and 6. Also, the main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
