DEV Community

Hamza Hesham
Hamza Hesham

Posted on • Edited on

5 2

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay