Unit 03 — Functions, Parameters & Return Values
Prerequisite: Unit 02 — data types, variables, expressions
Learning goal: Write reusable functions that accept inputs and return the expected type and value.
Work through the following four lessons in order. Each introduces a focused new skill, builds from earlier material, and includes a coded practice task. Review the example, predict its behavior, then use the browser editor to run and check your work.
| # | Lesson | New skill | Points |
|---|---|---|---|
| 1 | Returning an answer | Function definitions and return | 5 |
| 2 | Working with two inputs | Parameters and arguments | 5 |
| 3 | Return a string | String expressions and return types | 10 |
| 4 | Build: Rectangle Area Tool | Reusable functions and expressions | 15 |
Open the interactive lessons (Units 02–06). Browser checking is practice; submitted code is graded by GitHub Actions once the corresponding PR contains the new main.py file.
Learning reminders
- Write and run code yourself before revealing hints.
- Use print only in tasks that specifically require console output; for function challenges, use
return. - Explain your reasoning, including how a boundary or unusual input should behave.
- The first two tasks introduce skills, the third combines skills, and the final task is cumulative.