forked from Mrinank-Bhowmick/python-beginner-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (29 loc) · 801 Bytes
/
main.py
File metadata and controls
31 lines (29 loc) · 801 Bytes
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
import random
# Ask user for the type of they want!
dice_type = int(input("Pick a Dice type: \n1. D4\n2. D6\n3. D8\n4. D10\n5. D12\n6. D20\n7. D100\n\n"))
# use switch cases introduced in Python 3.10
match dice_type:
case 1:
number = random.randint(1, 4)
print(number)
case 2:
number = random.randint(1, 6)
print(number)
case 3:
number = random.randint(1, 8)
print(number)
case 4:
number = random.randint(1, 10)
print(number)
case 5:
number = random.randint(1, 12)
print(number)
case 6:
number = random.randint(1, 20)
print(number)
case 7:
number = random.randint(1, 100)
print(number)
case _:
print("Not a valid option, Adios <3")
exit()