142k views
8 votes
Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.

Print each roll on its own line.

User Sanman
by
7.1k points

1 Answer

2 votes

import random

for x in range(100):

print(random.randint(1,6))

I wrote my code in python 3.8. I hope this helps.

User Ankur Loriya
by
7.7k points