Skip to content

Commit 3461c03

Browse files
committed
2 parents a476438 + 0fa8682 commit 3461c03

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

002 - Dice Roll/diceroll.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
print("**********************************")
66

77
while True:
8-
askuser = input("Do you want to roll the dice? (y/n): ")
9-
if askuser == "y" or askuser == "Y": # Check both conditions separately
8+
askuser = input("Do you want to roll the dice? (y/n): ").lower()
9+
if askuser == "y" or askuser == "yes":
1010
print("Rolling...")
1111
time.sleep(1.5)
1212
num = random.randint(1, 6)
13-
print("You got", num)
14-
elif askuser == "n" or askuser == "N": # Check both conditions separately
15-
print("Goodbye!")
13+
print("You got", num, "!")
14+
elif askuser == "n" or askuser == "no":
15+
print("Not cool! Goodbye!")
1616
break
1717
else:
1818
print("Invalid input")
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)