Python Quest

Guide

Browser Python and your own computer

Everything you run in Python Quest is real Python, running inside your browser. Here is what that means, what is different, and how to carry on with Python on your own computer.

How your code runs

Python Quest runs CPython 3.14.2 — the standard Python — compiled to WebAssembly (Pyodide 314.0.7). It runs on your device, in an isolated frame that can't read the page, your cookies or your account. Nothing you type is executed on our servers while you practise.

  • The first run on a page downloads Python once (about 10 MB, then cached by your browser). Later runs start in well under a second.
  • Each exercise has its own interpreter, so variables from one exercise never leak into another.
  • Every run starts in a fresh working folder containing the exercise's files. Files your program writes exist only during that run.
  • Runs are stopped after a time limit (usually 8–20 seconds). If a loop never ends, press Stop or wait: Python is restarted automatically and your code is kept.
  • random is seeded the same way each run, so results are repeatable. Call random.seed() with no argument if you want different numbers each time.

Typing input

When your program calls input(), a box appears in the output panel. Type a line and press Enter. Behind the scenes Python Quest reruns your program from the start with every line you have typed so far — that's why output before the prompt reappears instantly. The text you pass to input() as a prompt is shown but never graded.

What's included

  • The whole standard library that makes sense in a browser: math, random, statistics, datetime, collections, itertools, functools, json, csv, re, pathlib, dataclasses, typing, enum, logging, asyncio, unittest and more.
  • Curated packages, loaded automatically when you import them: NumPy, pandas, matplotlib (charts appear in the output panel) and pytest.

What's different from Python on your computer

FeatureIn Python QuestOn your computer
Installing packagesOnly the curated packages above. pip install isn't available.Anything from PyPI with pip install, ideally inside a virtual environment.
Internet accessTurned off. Lessons about APIs use saved responses.urllib, requests and friends work normally.
FilesA temporary folder per run, with the exercise's files.Your real disk: files stay after the program ends.
Windows and GUIstkinter and turtle can't open windows in a web page.Both work.
Threads and processesNot available; asyncio works for concurrency lessons.threading, multiprocessing and subprocess work.
SpeedUsually 1.5–3× slower than native Python. Fine for everything in the course.Full speed.
Command-line argumentssys.argv is ['main.py']; lessons pass arguments to argparse as a list.Whatever you type after python main.py.

Installing Python on your own computer

  1. Download Python 3 from python.org/downloads. On Windows, tick Add python.exe to PATH in the installer. On macOS you can also use the official installer; on Linux Python is usually preinstalled.
  2. Check it works: open a terminal and run python --version (on macOS and Linux: python3 --version).
  3. Install an editor. Visual Studio Code with the Python extension is free and popular; IDLE comes with Python.
  4. Save a file such as hello.py and run it with python hello.py.
  5. For projects with packages, create a virtual environment: python -m venv .venv, activate it, then pip install pandas. Track 10 explains this step by step.

Code you write in Python Quest runs unchanged on your computer. In the playground, use Export to download a project as a .zip.

# Works the same in Python Quest and on your computer
from pathlib import Path

notes = Path("notes.txt")
notes.write_text("first line\n", encoding="utf-8")
print(notes.read_text(encoding="utf-8"))

How checking works

Check runs your code against the exercise's requirements: normal cases, edge cases and sometimes hidden cases. Each requirement says whether it passed and, if not, what was expected, what your code produced, and what to look at. Different correct approaches all pass — the checks look at results and behaviour, and only occasionally at structure when the exercise is about a specific tool (for example “use a loop”).

Checks run in your browser, on your device. Track tests and the final exam are graded the same way, in practice mode, and your results are saved to your history.

Keyboard and accessibility

  • Ctrl+Enter (⌘+Enter on Mac) runs; Shift+Enter checks.
  • Tab indents inside the editor. Press Esc then Tab to move focus out of it.
  • Prefer a plain text box (works better with some screen readers and voice control)? Use the “plain editor” option under any editor; it is remembered on this device.
  • Output, errors and check results are announced to screen readers. Colour is never the only signal: every result has a ✓/✗ and text.