I have made a sided dice random generator , but i need for the programme to at the bottom print out 1 was rolled x amount of times 2 was rolled x amount of times and so on. how can I achieve this.
my code is :
import random
print("Six sided dice programme")
count = 1
while True:
answer = str(input("would you like to roll, 'y' for yes, 'n' for no:"))
if answer == 'y':
roll=random.randint(1,6)
print("roll number" , str(count) , ":" , roll)
count = count + 1
if answer == "n":
print("Game over")
break
question from:https://stackoverflow.com/questions/65918535/adding-up-total-times-a-number-was-rolled-on-a-dice-in-python-3