-
Notifications
You must be signed in to change notification settings - Fork 0
/
runner.py
48 lines (38 loc) · 1.16 KB
/
runner.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
47
48
"""Main function."""
import exercize
import utils
def run_first():
"""Run the fisrt assignment."""
musts = exercize.first_five_lowest_current_rent()
for must in musts:
print(must, "\n")
def run_second():
"""Run the second assignment."""
musts = exercize.twenty_five_lease()
for must in musts:
print(must, "\n")
total_rent = sum([float(must["Current Rent"]) for must in musts])
print("the total rent of these must is: %s" % str(total_rent))
def run_third():
"""Run the third assignment."""
musts = exercize.tenants()
for k, v in musts.items():
print(v, k)
def run_fourth():
"""Run the fourth assignment."""
musts = exercize.list_rental_by_lease_date()
for must in musts:
line = list()
for k, v in must.items():
if k != "Lease Start Date":
line.append(v)
continue
lease_date = utils.str2date(must["Lease Start Date"])
lease_date_str = utils.date2str(lease_date)
line.append(lease_date_str)
print(line)
if __name__ == "__main__":
run_first()
run_second()
run_third()
run_fourth()