You are viewing a single comment's thread. Return to all comments →
Python 3
import datetime def libraryFine(d1, m1, y1, d2, m2, y2): returned = datetime.datetime(y1, m1, d1) duedate = datetime.datetime(y2, m2, d2) late_days = (returned - duedate).days if late_days <= 0: return 0 if returned.year == duedate.year: if returned.month == duedate.month: return 15 * late_days return 500 * (returned.month - duedate.month + 12*(returned.year-duedate.year)) return 10000
Seems like cookies are disabled on this browser, please enable them to open this website
Library Fine
You are viewing a single comment's thread. Return to all comments →
Python 3