-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmadlibs(2).py
More file actions
38 lines (26 loc) · 1.11 KB
/
madlibs(2).py
File metadata and controls
38 lines (26 loc) · 1.11 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
33
34
35
36
37
38
def get_nouns():
nouns = {}
for i in range(1,4):
nouns[f"noun{i}"] = input(f"Noun{i}: ")
return nouns
nouns = get_nouns()
def get_adj():
adjs = {}
for i in range(1,4):
adjs[f"adj{i}"] = input(f"Adjective{i}: ")
return adjs
adjs = get_adj()
def get_verbs():
verbs = {}
for i in range(1,4):
verbs[f"verb{i}"] = input(f"Verb{i}: ")
return verbs
verbs = get_verbs()
madlib = f"One {adjs['adj1']} morning, a {nouns['noun1']} met a {adjs['adj2']} {nouns['noun2']} . \
The {nouns['noun1']} decided to {verbs['verb1']}, but the {nouns['noun2']} began to {verbs['verb2']} instead. \
Suddenly, a {adjs['adj3']} {nouns['noun3']} appeared and started to {verbs['verb3']} loudly. \
The {nouns['noun1']}, the {nouns['noun2']}, and the {nouns['noun3']} all looked at each other. \
Then the {adjs['adj1']} {nouns['noun1']} tried to {verbs['verb2']}, the {adjs['adj2']} {nouns['noun2']} tried to {verbs['verb3']}, \
and the {adjs['adj3']} {nouns['noun3']} decided to {verbs['verb1']}. \
Nobody knows why they did that … but it was definitely a {adjs['adj1']} day."
print(madlib)