From 0d0584f4bbcfe9275931b82eca5b973960cfb9e6 Mon Sep 17 00:00:00 2001 From: Kasun Hewagama <44252824+KasunHewagama@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:48:53 +0530 Subject: [PATCH] Added Dice_Rolling.py code...! --- python proj/Dice_Rolling.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 python proj/Dice_Rolling.py diff --git a/python proj/Dice_Rolling.py b/python proj/Dice_Rolling.py new file mode 100644 index 0000000..25c117c --- /dev/null +++ b/python proj/Dice_Rolling.py @@ -0,0 +1,13 @@ +import random +print("-: Welcome to Dice Rolling Game :-") +while True: + choice= input("Do you want to play?[Y/N]: ") + if choice.lower()=="y": + print("Rolling the dice...") + number=random.randint(1,6) + print("The number on the dice is: ",number) + elif choice.lower()=="n": + print("Ending the game...") + break + else: + print("Invalid choice")