Dice rolling game using python

oxy_oxide

Hamza Hesham

Posted on May 19, 2020

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.

💖 💪 🙅 🚩
oxy_oxide
Hamza Hesham

Posted on May 19, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related