forked from sumedha3111/Python-for-Beginners
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdice.py
More file actions
Latest commit
21 lines (15 loc) · 540 Bytes
/
Copy pathdice.py
File metadata and controls
21 lines (15 loc) · 540 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Random module is imported here to generate random numbers.
importrandomasrm
condition=True
whilecondition:
rand_num=rm.randrange(1,7)
print("Dice's output",rand_num)
user_choice=input("Hey,do you want to roll the dice again.(Y/N):")
ifuser_choice=='N'oruser_choice=='n':
condition=False
print("See you next time")
elifuser_choice=='Y'oruser_choice=='y':
condition=True
else:
print("Please enter a valid choice")
condition=False