-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path06-flow-control.py
More file actions
63 lines (59 loc) · 1.81 KB
/
06-flow-control.py
File metadata and controls
63 lines (59 loc) · 1.81 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
messageTemplate = "Hey, I'm really glad that {friend} was able to introduce us at {event}. {pronoun} the best! Your office on {street} is actually on my way to {sport} practice, so if you have time on {day}, maybe I could swing by and we could talk about the {jobTitle} position."
warmIntros = [
{
"friend": "Carmen",
"event": "HackerNest",
"gender": "female",
"street": "Hastings",
"sport": "dodgeball",
"day": "Tuesday",
"jobTitle": "software engineer"
},
{
"friend": "Thomas",
"event": "the React workshop",
"gender": "male",
"street": "Columbia",
"sport": "fencing",
"day": "Easter",
"jobTitle": "project manager"
},
{
"friend": "Carmen", # Again. She's the best.
"event": "Demo Day",
"gender": "female",
"street": "Hastings",
"sport": "dodgeball",
"day": "Wednesday",
"jobTitle": "front-end developer"
},
{
"friend": "David",
"event": "Beer Pong",
"gender": "",
"street": "Broadway",
"sport": "badminton",
"day": "Friday",
"jobTitle": "social media guru"
},
{
"friend": "Sam",
"event": "Intro to Crossfit",
"gender": "nonbinary",
"street": "Burrard",
"sport": "squash",
"day": "Sunday",
"jobTitle": "assistant to the regional manager"
}
]
for intro in warmIntros:
if intro["gender"] is "female":
pronoun = "She's"
elif intro["gender"] is "male":
pronoun = "He's"
else:
pronoun = "That person is"
if intro["day"] is "Saturday" or intro["day"] is "Sunday":
intro["day"] = "say, Monday or Tuesday"
print(messageTemplate.format(**intro, pronoun=pronoun))
print("\n📨\n")