I am new to python and programming in general. I am trying to create a dice simulator that will allow the user the choose how many sides the dice has and how many times to roll the dice. Then the program is supposed to keep track of how many times each number comes up and display the result.
I have gotten this far, where the random number generator will generate a random number for each roll. But i can't figure out how to track the number of times each number comes up and display that. Please help:
# dice simple
import random
x = input ("How many sides does you dice have?")
y = input ("How many times do you want to roll?")
for i in range (y):
z = random.randint (1, x)
defaultdict
fits nicely: