-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary Fine.py
More file actions
27 lines (24 loc) · 977 Bytes
/
Library Fine.py
File metadata and controls
27 lines (24 loc) · 977 Bytes
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
__author__ = 'voelunteer'
def library_fine(return_date, schedual_date):
schedual_date_list = schedual_date.split()
return_date_list = return_date.split()
for i in range(3):
schedual_date_list[i] = int(schedual_date_list[i])
return_date_list[i] = int(return_date_list[i])
if return_date_list[2] == schedual_date_list[2]:
if return_date_list[1] == schedual_date_list[1]:
if return_date_list[0] <= schedual_date_list[0]:
return 0
else:
return 15 * (return_date_list[0] - schedual_date_list[0])
elif return_date_list[1] < schedual_date_list[1]:
return 0
else:
return_month = return_date_list[1]
schedual_month = schedual_date_list[1]
return 500 * (return_month - schedual_month)
elif return_date_list[2] < schedual_date_list[2]:
return 0
else:
return 10000
print(library_fine(input(), input()))