Question: in python A single die has 6 sides, each with numbers 1, 2, 3, 4, 5, 6. The probability (%) of rolling a number is

 in python A single die has 6 sides, each with numbers

in python

A single die has 6 sides, each with numbers 1, 2, 3, 4, 5, 6. The probability (%) of rolling a number is 16.7%, This is calculated by 100/6. I would like you to create a program which will show this outcome. To simulate rolling a die, we can use the random function. Remember we need at the top of our program the "import random statement. We can then call the "random.sandiot function using the parameters (1, 6). The program will ask the user how many times to roll the dice (N). We can then use a counted loop for N. After each roll, we need to track the results of each roll (did we roll a 1 or 2 or... We can use variables for this. After the dice is rolled N times, we will output the results of how many times each number was rolled and the % of each number that was rolled. To get this percentage we divide the number of rolls for that number, by N (then multiply by 100). So for example, if Nis 10, the output can look like below: How many times you want to roll the dice?10 The dice roll statistics: 1: 110.00 % 2: 1 10.00 % 3: 4 40.00% 4: 3 30.00% 5: 0 0.00 % 6: 110.00 % You will submit a flowchart, your pseudocode, and your Python program (properly commented)

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!