Lesson 3: f-strings, putting values neatly into text
13 min read·14 Oct 2026
Module 3 · Lesson 3 · About 40 minutes · Needs: Module 3 Lessons 1 and 2 (strings, string methods), Module 2 (numbers, str())The situation
Amira wants a printed slip for every overdue loan, to tuck inside the reminder she hands over the counter. She starts with Ben. His loan is L13, The War of the Worlds, borrowed on shelf day 21, so it was due on day 35. Today is day 44: Ben is 9 days late and owes 180 pence.
You already hold those values in variables. What you lack is a tidy way to put them into text, with pence shown as pounds and values lined up. That is this lesson.