-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdice.py
More file actions
32 lines (30 loc) · 1.02 KB
/
dice.py
File metadata and controls
32 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import random
import time
import sys
min = 1
max = 6
def dicee():
roll_again = "yes"
diceq = input("\nDo you want one or two dice??1/2 ")
if diceq == "1":
while roll_again == "yes" or roll_again == "y" or roll_again == "Y":
print("Rolling dice...")
time.sleep(0.3)
print("The value is... ")
time.sleep(0.5)
print(random.randint(min,max))
roll_again = input("Roll the dice again??y/n")
elif diceq == "2":
while roll_again == "yes" or roll_again == "y" or roll_again == "Y":
print("Rolling dices...")
time.sleep(0.3)
print("The values are... ")
time.sleep(0.5)
print(random.randint(min,max))
print(random.randint(min,max))
roll_again = input("Roll the dice again??y/n")
else:
print("I did not understand that. Try again by pressing return")
print("\n\tWELCOME TO DICE SIMULATOR!!")
print("\n\tWHERE YOU GET RANDOM NUMBERS FROM 1-6!!")
dicee()