I have been trying but struggling to make a rolling dice simulator in Python that is an assignment for school and am looking for some help for it. These are the instructions:
This project involves writing a program that simulates rolling a dice. When the program runs, it will randomly choose a number between 1 – 6. Have the dice roll 100 times. The program will count if it is a 1 or 2 or 3 or 4 or 5 or 6. After rolling the dice 100 times the program will output how many times each number was rolled. It should then ask you if you’d like to roll again, answer (1 for Yes) and (0 for No).
What you will be Using : Variables Integer Random Print For Loop and/or While Loop
I have two sections of code that I need to loop over:
import random
for x in range(100):
value = random.randint(1, 6)
print(value)
and:
value = input("Wanna roll? 1 yes 2 no:\n")
print(f'You entered {value}')
y={value}
while y=1
print(value)
What is an idiomatic way of doing this in Python?