From 1de13bd0b54f233e10043e1a3de96f4fac7aefed Mon Sep 17 00:00:00 2001 From: aashishjakhar <113769749+aashishjakhar@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:40:46 +0530 Subject: [PATCH] Create Dice Roll Simulator.py --- Dice Roll Simulator.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dice Roll Simulator.py diff --git a/Dice Roll Simulator.py b/Dice Roll Simulator.py new file mode 100644 index 0000000..7664812 --- /dev/null +++ b/Dice Roll Simulator.py @@ -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?")