dice rolling python program 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: how to make a dice program in python
import random
run = 1
level = 0
while(run == 1):
print("**ROUND " + str(level) + "**")
print("player 1: ",random.randint(0, 6))
print("player 2: ",random.randint(0, 6))
run = int(input("enter 1 to go again or 0 to end: "))
print("")
level += 1