I am trying to write a code that would select 5 numbers between 1-10 and choose the maximum of them. I repeat the experiment 1000 times but I want to see how many times ı get the which result
import random
for i in range (1,1000):
b = random.choices(range(1, 11), k=5)
max(b)
print("The X value for %(n)s is {%(c)s} " % {'n': b, 'c': max(b)})
I want to see something like 10 occurring 500 times, 9 occurring 300 times. I tried to define a dictionary but couldn't manage to do so. Any help would be appreciated