-
Notifications
You must be signed in to change notification settings - Fork 133
/
29_fortune_cookie_2.py
46 lines (40 loc) · 1.12 KB
/
29_fortune_cookie_2.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Fortune Cookie 🥠
# Codédex
import random
options = [
'Don’t pursue happiness – create it.',
'All things are difficult before they are easy.',
'The early bird gets the worm, but the second mouse gets the cheese.',
'If you eat something and nobody sees you eat it, it has no calories.',
'Someone in your life needs a letter from you.',
'Don’t just think. Act!',
'Your heart will skip a beat.',
'The fortune you search for is in another cookie.',
'Help! I’m being held prisoner in a Chinese bakery!'
]
def fortune():
random_fortune = random.randint(0, len(options) - 1)
if random_fortune == 0:
option = options[0]
elif random_fortune == 1:
option = options[1]
elif random_fortune == 2:
option = options[2]
elif random_fortune == 3:
option = options[3]
elif random_fortune == 4:
option = options[4]
elif random_fortune == 5:
option = options[5]
elif random_fortune == 6:
option = options[6]
elif random_fortune == 7:
option = options[7]
elif random_fortune == 8:
option = options[8]
else:
option = 'Error'
print(option)
fortune()
fortune()
fortune()