From 2ae8ca50067cb51c449169c3b589b4448464d009 Mon Sep 17 00:00:00 2001 From: Mark Engelmann <61390579+vinegar-tom@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:35:41 -0500 Subject: [PATCH] Clarify overdue fine function The `else` statement used a redundant calculation that is the same as multiplying the days by `0.75`. --- episodes/writing-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/episodes/writing-functions.md b/episodes/writing-functions.md index faafd268..a865e002 100644 --- a/episodes/writing-functions.md +++ b/episodes/writing-functions.md @@ -86,9 +86,9 @@ In the date example above, we printed the results of the function code to output ```python def calc_fine(days_overdue): if days_overdue <= 10: - fine = days_overdue * 0.25 + fine = days_overdue * 0.25 else: - fine = (days_overdue * 0.25) + (days_overdue * .50) + fine = days_overdue * 0.75 return fine fine = calc_fine(12)