Answer:
Step-by-step explanation:
The following program uses Numpy import to detect the frequency of all the elements in an array and ouput the one that appears the most. The function creates random dice rolls and adds them to the array, looping the number of times that the trials parameter states. Then finally printing out the original array and the sum that appeared the most frequently.
from random import randrange
import numpy as np
def highestFrequency(trials):
products = []
for x in range(trials):
product = randrange(1, 7) * randrange(1, 7)
products.append(product)
x = np.array(products)
print("Original Array: " + str(list(products)))
print("Most frequent value in the above array:")
print(np.bincount(x).argmax())
highestFrequency(7)