Question: Write the function in Python please, provide explanation for each line of code and include a snapshot to allow for viewing of correct indentation Write

Write the function in Python please, provide explanation for each line of code and include a snapshot to allow for viewing of correct indentation

Write a function def make_dictionary(d) that will simulate 100 dice rolls of d six-sided dice - The function must count the number of times each total of the dice occurs - The function must create and return a dictionary of keys from d to d * 6 inclusive, with each key having a corresponding value which is the number of times each total of the dice occurs - Must use the following code to generate same set of random numbers: import random random.seed(30)

Must provide the following answers:

print(make_dictionary(2))
{2: 2, 3: 6, 4: 6, 5: 11, 6: 16, 7: 15, 8: 16, 9: 15, 10: 7, 11: 5, 12: 1}
print(make_dictionary(1))
{1: 19, 2: 19, 3: 15, 4: 14, 5: 19, 6: 14}

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!