Programming
Python Variable Trace Table Generator
Code
Input for input() — one line per call
Runs real Python 3.11 (Pyodide) in your browser. Ctrl+Enter runs; after running, use ← and → to step.
Step through
Press Run to execute the code. The first run downloads the Python runtime (about 10 MB, once per visit).
Programs that run longer are stopped, so an infinite loop cannot freeze the page.
How to use this tool
- 1Paste a Python program or pick an example such as a loop.
- 2Press Run: the program runs with real Python and every line is traced.
- 3Read the table; turn on “Only show changed values” for the classic hand-written style.
- 4Download it as CSV or copy it as a Markdown table.
Frequently asked questions
Each row is a line that ran, in order. The variable columns show values after that line finished, which is how trace tables are drawn for exams and dry runs.
Yes. "Only show changed values" leaves a cell blank unless the variable changed on that line.
In "All lines" mode, local variables of a function appear as function.variable columns; choose "Main program only" to trace just the top-level code.
No. The tool runs real Python 3.11 (Pyodide, Python compiled to WebAssembly) inside your browser. The first run downloads the runtime (about 10 MB) once per visit; your code never leaves your device.
Related tools
Python Line-by-Line Executor — Step Execution
Run Python one line at a time: see the line about to run, output as it is printed, changed variables and line counts.
Python Variable Tracker — Track State Changes
Track every Python variable through a run: each value it took, on which line, type changes and a chart for numbers.
Python Debugging Practice — Find & Fix Bugs
Practise fixing 20 short Python programs with classic bugs, checked by running your fix with real Python.