Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Dice Roll Simulator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import random

#range of the values of a dice
min_val = 1
max_val = 6

#to loop the rolling through user input
roll_again = "yes"

#loop
while roll_again == "yes" or roll_again == "y":
print("Rolling The Dices...")
print("The Values are :")

#generating and printing 1st random integer from 1 to 6
print(random.randint(min_val, max_val))

#generating and printing 2nd random integer from 1 to 6
print(random.randint(min_val, max_val))

#asking user to roll the dice again. Any input other than yes or y will terminate the loop
roll_again = input("Roll the Dices Again?")