Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PythonMaxxing

A fully static React + Vite app for practicing Python list and dictionary comprehensions, Zetamac style. Python is evaluated entirely in the browser via Pyodide.

Getting Started

cd frontend
npm install
npm run dev          # Start development server
npm run build        # Build for production
npm run preview      # Preview the production build locally

How It Works

  • 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, range iteration, string slicing, etc.).
  • Pyodide (~10 MB) is loaded from the jsDelivr CDN on first mount and cached by the browser thereafter.

Game Modes

  • 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.

Levels

  1. Simple [expr for x in xs]
  2. Filtered [x for x in xs if cond]
  3. Conditional expression [expr_if_else for x in xs]
  4. Nested loop [(x, y) for x in xs for y in ys]
  5. Dict comprehension {x: expr for x in xs}
  6. Filtered dict comprehension {x: expr for x in xs if cond}

About

zetamac for python list/dict comprehensions

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages