Blog
Roll the Dice!
- Harshit
- July 18, 2020
- 9:42 am
- One Comment
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?"))
so fun thanks bro