runtime
392 / 500
question 392 Software Architecture · easy

Fix the late fee that depends on today's date

late_fee gives different answers depending on the day the tests run: it reads the real clock inside the business rule. Make the rule pure: it should take today as a parameter (a date), and keep the fee rules unchanged.

Functionlate_fee(due, today); both are datetime.date objects
Rule0 if returned on or before the due date; otherwise 1.50 per day late, at most 15.00

Loading your progress…

Fix the late fee that depends on today's date — Python practice · Runtime