CoursePython from Scratch to Intermediate · Module 2: Values, Types and Operators · part 14 of 75
Part 14 · Module 2: Values, Types and Operators

Lesson 1: Numbers and sums: what does Ben owe?

14 min read·14 Oct 2026
Module 2 · Lesson 1 · About 35 minutes · Needs: Module 1 (print, variables, reading an error)

The situation

Amira has a question for you this morning: "What does Ben owe if he is 9 days late?" Ben borrowed The War of the Worlds (loan L13) and has not brought it back. Today is Wednesday 14 October 2026.

In Module 2 dates are shelf days: the day's number counted from 1 September, so 14 October is day 44. Ben borrowed on day 21. A loan lasts 14 days, and the fee is 20 pence for each day late. Answering Amira takes three sums. This lesson teaches the numbers and operators that do them, and one trap with decimals that real systems have fallen into.

WHAT DOES BEN OWE? borrowed day 21 due day 35 days late 9 fee 180 pence
Amira's question turns into four numbers and three sums. Blue is a value your code works out; green is the answer.

Each box is one number your code will work out; the green one is Amira's answer.

The rest of this part opens with an account

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