random dice roll in python code example
Example 1: dice rolling simulator python
from random import randint
def roll_dice():
print(f"Number is: {randint(1,6)}")
roll_dice()
whatever = 12
for number in range(whatever):
roll_dice()
Example 2: roll dice python
import random
diceRoll = random.randint(1, 6)
print(diceRoll)
Example 3: how to make a dice in python
from random import randint
dice_roll = randint(1,6)
print("You Threw a", dice_roll)
import time
from random import randint
for j in range(10):
dice_roll = randint(1,6)
time.sleep(3)
print("You threw a", dice_roll)