how to make a dice program in python

Solutions on MaxInterview for how to make a dice program in python by the best coders in the world

showing results for - "how to make a dice program in python"
Sarah
22 Jan 2017
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
Vincent
02 Oct 2018
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
queries leading to this page
dice python dice pythondice simulator codepython dice rollpython random dicedice rolling python programmake a dice in pythongame of dice pythondice roll game pythondice problem in pythonpython dicepython dice rollinghow to program a 2 dice pythondice program in pythondice function pythonhow to make dice roll in pythonhow to make a dice in pythondice with pythondice rolling pythonpython die and dice work 3fhow to make dice in pythonrandom dice roll in pythonpython roll dicepython dice gamehow to display a dice in pythondice roll in pythondice roller python 3how to make dice roller in pythondice rolling program pythonroll the dice in pythonhow to make a dice game in pythonhow to make a dice program in pythondice roll pythonhow to make a dice roller in pythonpython code for dice gameroll a dice in pythonhow to program a dice pythondice rolling simulator python codehow to make a dnd dice program in pythondice program pythondice python programroll dice pythonpython dice roll functionpython dicesdice rolling function pythonhow to display a dice with a particular number in pythonpython dice game examplerolling a dice program in pythonsimple dice roller python codepython dice rollerdice problem with pythondice roller in pythondice in pythonhow to display a dice in python 3python dice scriptpython roll dice functionroll dice generator pythonpython dnd dice rollerdice roll coe pythonpython roll dice codehow to make a dice in pythinhow to roll a dice in pythonpython module for rolling dicehow to roll dice in pythonpython code to roll a dice python dice roll exampledice roller pythonhow to create a dice roll in pythonexplain dice program in pythonhow to make a dice roll in pythonroll a dice game python 24 python3 i dice pydice game pythondice rolling simulator pythondnd dice pythonhow to make a dice program in python