A fully static React + Vite app for practicing Python list and dictionary comprehensions, Zetamac style. Python is evaluated entirely in the browser via Pyodide.
cd frontend
npm install
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview the production build locally- Question generation runs in JavaScript: random schema selection, filter/output picking, target-code assembly.
- Evaluation runs in Python via Pyodide. Both the reference answer and the user's submission are
eval'd against the same namespace, and equality is checked in Python so semantics match CPython exactly (dict comparison, tuple equality,rangeiteration, string slicing, etc.). - Pyodide (~10 MB) is loaded from the jsDelivr CDN on first mount and cached by the browser thereafter.
- Normal Mode: self-paced practice. Pick a level (1–6) and grind.
- Timed Mode: pick a time limit and one or more levels, then answer as many as you can.
- Simple
[expr for x in xs] - Filtered
[x for x in xs if cond] - Conditional expression
[expr_if_else for x in xs] - Nested loop
[(x, y) for x in xs for y in ys] - Dict comprehension
{x: expr for x in xs} - Filtered dict comprehension
{x: expr for x in xs if cond}