-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathday_9_start.py
46 lines (34 loc) · 1.16 KB
/
day_9_start.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
import datetime
default_names = ["Justin", "john", "Emilee", "Jim", "Ron", "Sandra", "veronica", "Whitney"]
default_amounts = [123.32, 94.23, 124.32, 323.4, 23, 322.122323, 32.4, 99.99]
unf_message = """Hi {name}!
Thank you for the purchase on {date}.
We hope you are exicted about using it. Just as a
reminder the purcase total was ${total}.
Have a great one!
Team CFE
"""
def make_messages(names, amounts):
messages = []
if len(names) == len(amounts):
i = 0
today = datetime.date.today()
text = '{today.month}/{today.day}/{today.year}'.format(today=today)
for name in names:
"""
Here's a simple solution to capitalize
everyone's name prior to sending
"""
name = name[0].upper() + name[1:].lower()
"""
Did you get the bonus??
"""
new_amount = "%.2f" %(amounts[i])
new_msg = unf_message.format(
name=name,
date=text,
total=new_amount
)
i += 1
print(new_msg)
make_messages(default_names, default_amounts)