Late Book Fine
A library calculates a fine based on how late a book was returned. The function library_fine receives the actual return date d1, m1, y1 and the expected due date d2, m2, y2. If the book was returned on time or early, the fine is 0; if it was late in the same month and year, charge 15 per late day; if it was late in the same year, charge 500 per late month; if it was returned in a later year, charge 10000. Return the final fine.
Примеры
Ввод
9, 6, 2015, 6, 6, 2015Вывод
45Ввод
6, 6, 2015, 6, 6, 2015Вывод
0Ввод
1, 1, 2016, 1, 1, 2015Вывод
10000Нужно реализовать
def library_fine(d1: int, m1: int, y1: int, d2: int, m2: int, y2: int) -> int:
Теги
math
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seVisible tests
1
Input
9, 6, 2015, 6, 6, 2015Expected
452
Input
6, 6, 2015, 6, 6, 2015Expected
03
Input
1, 1, 2016, 1, 1, 2015Expected
100004
Input
1, 3, 2015, 1, 1, 2015Expected
10005
Input
1, 1, 2015, 5, 5, 2015Expected
06
Input
6, -100, 2015, 6, 6, 2015Expected
0Focus radio
Paused · SomaFM · Fluid