Question: Write program that uses a function named throwDie that simulates throwing a die. When you call the function, it should generate a random number in

Write program that uses a function named throwDie that simulates throwing a die. When you call the function, it should generate a random number in the range of 1 through 6. Demonstrate the function in a program that asks the user how many times the die should be thrown, then simulates the throwing of the die that number of times. At the end of the program display the number of times each value appears. Note: Your solution MUST have and call a function to do the die throw in order to get full credit for this assignment!

The output should look something like this: How many die throws should I make? 8

1:      1

2:      5

3:      3

4:      6

5:      3

6:      4

7:      5

8:      1

 

 

1 appears 2
2 appears 0
3 appears 2
4 appears 1
5 appears 2
6 appears 1

Step by Step Solution

3.40 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python program that uses a function called throwDie to simulate throwing a die python import ... View full answer

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!