1from random import randint
2
3def roll_dice():
4 print(f"Number is: {randint(1,6)}")
5
6# Do this to simulate once
7roll_dice()
8
9# Do this to simulate multiple times
10whatever = 12 # Put the number of times you want to simulate here
11for number in range(whatever):
12 roll_dice()
1#For one time roll
2from random import randint
3
4dice_roll = randint(1,6)
5#You can change numbers to anything you want, it can go up to 1 million if you really want it to
6print("You Threw a", dice_roll)
7#That's for one time throw but if you want it for multiple people then do this
8
9#For multiple roles
10import time
11from random import randint
12for j in range(10):
13 dice_roll = randint(1,6)
14 time.sleep(3)
15 print("You threw a", dice_roll)
16
17
1import random
2run = 1
3level = 0
4while(run == 1):
5 print("**ROUND " + str(level) + "**")
6 print("player 1: ",random.randint(0, 6))
7 print("player 2: ",random.randint(0, 6))
8 run = int(input("enter 1 to go again or 0 to end: "))
9 print("")
10 level += 1
11
1import random
2
3roll_dice = random.randint(1, 6)
4print(roll_dice)