CoursePython from Scratch to Intermediate · Module 6: Functions · part 41 of 75
Part 41 · Module 6: Functions

Lesson 2: Parameters, the different ways to pass values in

17 min read·14 Oct 2026
Module 6 · Lesson 2 · About 45 minutes · Needs: Module 6 Lesson 1 (def, return, parameters), Module 5 (lists, tuples, dictionaries), Module 3 Lesson 3 (f-strings)

The situation

Lesson 1 gave you reminder_text(name, title, days_late). Ben has The War of the Worlds out on loan L13, 9 days late, so his reminder says he owes £1.80. Now Amira wants more. Tom hands out reminders on Saturdays, so some should be signed by him. She wants one function that totals the fees for however many loans she names. And she wants calls that are hard to get wrong, because a reminder with the title where the name should be is embarrassing.

All of that is about one thing: how values travel from a call into a function.

WHAT YOU PASS IN "Ben" "The War of the Worlds" 9 reminder_text(...) Dear Ben, The War of the Worlds is overdue. Days late: 9. Fee so far: £1.80.
Three values you pass (blue) go into reminder_text and come out as Ben's reminder (green); this lesson is about the ways those values can travel in.

The rest of this part opens with an account

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