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?")