Roll the Dice!

A simple code to roll two dices while playing board games with your friends.

Welcome to the code! Wait… Lost your dices? That’s so sad. But, don’t worry! You can use this code to replace your dices.

In this code, the computer rolls two dices and prints two random numbers just like the dices.

Note: Loved the post? You too can publish your article on “Python for fun” which will be loved by millions. Contribute an article!

							
							
					import random
min = 1
max = 6

roll_again = "yes"

while roll_again == "yes" or roll_again == "y":
    print ("Rolling the dices...")
    print ("The values are....")
    print (random.randint(min, max))
    print (random.randint(min, max))

    roll_again = input(("Roll the dices again?"))				
			
Share on facebook
Share on whatsapp
Share on twitter
0 0 votes
Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments