CoursePython from Scratch to Intermediate · Module 4: Decisions and Loops · part 27 of 75
Part 27 · Module 4: Decisions and Loops

Lesson 1: Making decisions: is this loan overdue?

16 min read·14 Oct 2026
Module 4 · Lesson 1 · About 40 minutes · Needs: Modules 1 to 3 (variables, comparisons, and/or/not, truthy and falsy values, int())

The situation

Amira has a new question: "Which of these twelve loans are overdue?" Your code can work out Ben's 9 days late, but it cannot yet say "late" for one loan and "fine" for another.

This lesson gives your code a choice. You will follow Ben's L13, The War of the Worlds, borrowed on shelf day 21 and not back. Today is shelf day 44. Lesson 2 repeats the decision for all twelve loans.

ONE LOAN, ONE DECISION L13, Ben borrowed day 21 due day 35 44 > 35 ? the question overdue 9 days late
A decision turns a fact into an action: is today past the due day? Blue is your code's normal path, amber is the question being asked, red is the bad news.

The rest of this part opens with an account

Signing up is free and takes one email. Nothing to pay, and nothing renews.