Explore how Python executes. Visualise variables, data structures,
functions, loops, nested loops, object references, memory and program
flow through an interactive execution environment.
Python runtime not loadedThe Python engine loads when you run your first program.Powered by Pyodide / CPython
Python Code EditorWrite your Python program
Real Python execution · Supports indentation, functions, classes,
collections, nested loops and standard Python syntax.
Execution TracePython line-by-line history
Waiting for executionLine —
Run your code to generate an execution trace.
Step 0 / 0
Program Flowchart / Source MapCurrent statement highlighted
Select an example and run it. The explanation will update as you
navigate through the execution history.
Important Learning Notes
The Python engine runs in your browser using Pyodide. The first load requires an internet connection.
The stack and heap panels are simplified teaching visualisations of Python frames, local variables and object references. They are not a literal map of CPython's physical memory.
Execution history records Python line events. Multiple operations on one line may appear as a single trace event.
The flowchart is a source-line map with the current line highlighted. It does not yet represent every conditional branch or loop-back edge.
The loop monitor counts visits to loop-header lines. For a while loop, this can include the final condition check that ends the loop.
Do not run untrusted code. This is a browser-based learning environment, not a secure server-side code sandbox.