Computing & AI Class 9
Computational Thinking III: Functions & Debugging
Name, call and return a function — then trace, predict and halve to find bugs.
11 lessons · ~61 min total
Track progress — 0 of 11 lessons read 0%
Lessons in this topic
- 0 Start here Name a group of lines, hand it values, take one back. Then find bugs. · 3 min You are here
- 1 A name for a group of steps A function gives a group of lines one name. The printed lines stay the same. · 5 min
- 2 What you hand it, and what each end is called A parameter is a name in the definition. An argument is the value at the call. · 6 min
- 3 The value it hands back `return` sends one value out of a function. Printing is a different job. · 6 min
- 4 One call inside another A call is a value, so it fits inside another call. The inner call runs first. · 6 min
- 5 A print in the middle A `print` in the middle shows what a box held at that moment. · 6 min
- 6 One line at a time A trace table shows every box after every line. · 6 min
- 7 Predict, then run Write down what each line should print. Then run it and compare. · 6 min
- 8 Halve the hunt Check the middle line. Drop the half that cannot hold the fault. · 6 min
- 9 The big picture Four ideas that build a function. Four that find a fault. · 3 min
- 10 Track quiz A cheat-sheet table and a reveal quiz, one question for each idea. · 8 min
0%
Take this year's practice exam →
Draws questions from every track in this subject's year, not just this one — a Practice result, never official.