Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago