Question: Write a function dice () that takes an integer count as a parameter, simulates rolling a dice for count times, i.e. generating a random integer

Write a function dice() that takes an integer count as a parameter, simulates rolling a dice for count times, i.e. generating a random integer between 1 and 6 for count times, collects the information on the number of times when the dice stops at each possible value, i.e. from 1 to 6, and prints the collected information after the simulation. Your should use dictionary to implement the function and the function should NOT use any if statement. The following screenshot shows a couple of example runs:

Write a function dice() that takes an integer count as a parameter,

- O X Help Le Python 3.7.4 Shell File Edit Shell Debug Options Window >>> dice (10) 1 : 1 2 : 2 3 : 4 4 : 1 5 : 1 6 : 1 >>> dice (100) 1 : 14 2 : 16 3 : 16 4 : 18 5 : 19 6 : >>> Ln: 219 Col: 4

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!