Signature app
The call tree
For many, recursion is the moment programming gets spooky: a function calls itself, and somehow a result still comes out. The call tree shows what really happens, with your own Python code.
Software engineer and Python educator · University of Amsterdam
Expedition film


The tree behind recursion
A guided film on top of the live app. You choose whether it explains for children, beginners or experts, and you can pause at any time, step in yourself and ask questions.
The app
How it works
- Pick an example, say Fibonacci, and tap “Play”: the tree grows call by call.
- Move back and forth on the timeline: every node shows its arguments, its local variables and finally its return value.
- Under “Edit” you write your own Python and tap “Run”.
In full view the AI tutor sits next to the app and demonstrates it — moving the sliders, pointing at the spot and explaining as it goes.
For many, recursion is the moment programming gets spooky: a function calls itself, and somehow a result still comes out. The call tree shows what really happens, with your own Python code.
Background
What the subject is about
A recursive function solves a problem by handing a smaller problem of the same kind to itself. For this to end, it needs a base case, a stop condition where it answers without calling itself again. The factorial of 4 is 4 times the factorial of 3, and so on down to the factorial of 1.
In the call tree every call is a node with its own frame: its own arguments, its own local variables. On the way down the calls are made, on the way back up the results combine. Python works on exactly one node at a time while the others wait. That is why the tree grows in depth before it grows in width.
Fibonacci shows why naive recursion can get expensive: the same subproblems are computed again and again. Merge sort and the paths through a graph show where recursion is strong: it systematically tries every possibility and can drop a path early once it can no longer reach the goal.
In use
What the app is for
For everyone learning Python who gets stuck on recursion: as a live demo in the lecture, at home for working through it, and as an expedition film that explains the call tree in a few minutes, for beginners and experts alike.
If you have your own exercises, write your code straight into the app and see its tree at once.
The model
What his signature stands for
- The idea comes from his tool invocation_tree: every function call is a node of its own with its local variables and its return value, and the tree grows while the program runs.
- Three of the eleven examples come from his introduction to recursion: words without equal neighbours, collecting results and all paths through a graph. He suggested them himself.
- The code really runs: Python in the browser, without installation, as in his Invocation Tree Web Debugger.
- An educator who teaches recursion and Python’s data model to beginners and builds his own tools for it, stands as patron of the app.
The person

Bas Terwijn
Software engineer and Python educator · University of Amsterdam
Bas Terwijn is a software engineer and educator at the University of Amsterdam, where he teaches Python.
He develops open-source tools that show what goes on inside a Python program: memory_graph draws references, mutability and copies as a graph, and invocation_tree shows function calls as a growing tree. Both also run as web debuggers right in the browser.
More about Bas Terwijn
Your model. As an app with your signature.
You teach something that moves, calculates or branches? Send us your slides, exercises or demo. We build an app from it, you check it for accuracy and sign it.
