Lesson 4: Asking questions and printing answers
14 min read·14 Oct 2026
Module 2 · Lesson 4 · About 35 minutes · Needs: Module 2 Lessons 1 to 3 (numbers, strings, int())The situation
Amira has her answer from Lesson 1: Ben's copy of The War of the Worlds (loan L13) is 9 days late, so he owes 180 pence. But the number 9 is written into the code. Tomorrow it will be 10, and Lena or Jonah will be standing at the counter instead.
"Can it just ask me?" she says. "I type the name and how many days late, and it tells me what they owe."
The program has to show text neatly, which is output, and take text from the person at the keyboard, which is input. By the end Amira has a late-fee calculator she can run herself.