DEV Community

Hamza Hesham
Hamza Hesham

Posted on • Edited on

Python Dice Roll Dice rolling game using python

hello , today we will make a simple dice roll game .
first we will import random , and make two new variables :
minimum = 1
maximum = 6
then we will make a third variable called again and assign it to "yes".
Alt Text
second, we will make a while loop
Alt Text
in while loop we will print a statement "dice is rolling . . ."
then we will make a variable called x and assign it to :
x = random.randint(minimum,maximum)
and print x
after that we will change again to no :
again = "no"
and change it again to an input :
again = input("play again y/n\n")
to allow the player to play again .
the final code will be like :
Alt Text
thanks for reading.

Top comments (0)