Skip to content

Commit 3dbbc90

Browse files
authored
Create Dice.py
1 parent ea958f2 commit 3dbbc90

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dice-rolling-simulator/Dice.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import random
2+
3+
while True:
4+
Q = input("Do you want to roll a dice (Y/N): ")
5+
if Q.lower() == "y":
6+
dice1 = random.randint(1, 6)
7+
dice2 = random.randint(1, 6)
8+
print("You rolled:", dice1, dice2)
9+
elif Q.lower() == "n":
10+
print("Thanks for playing!")
11+
break
12+
else:
13+
print("Please enter a valid option (Y/N).")

0 commit comments

Comments
 (0)