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
PostgreSQLv16

Här visas resultatet av din kod

Visible tests
1
Input
9, 6, 2015, 6, 6, 2015
Expected45
2
Input
6, 6, 2015, 6, 6, 2015
Expected0
3
Input
1, 1, 2016, 1, 1, 2015
Expected10000
4
Input
1, 3, 2015, 1, 1, 2015
Expected1000
5
Input
1, 1, 2015, 5, 5, 2015
Expected0
6
Input
6, -100, 2015, 6, 6, 2015
Expected0
Focus radio
Paused · SomaFM · Fluid