Joel Stevick

Python tutorial

Taught by Claude

A repository of fifty Python exercises, from basics to a RAG pipeline and its eval harness. Clone it, open the folder in VS Code, and in Claude Code type /teach-me: Claude teaches you the next exercise from a worked example, you write it from memory, and /check scores it. /progress shows how far you are.

After the last exercise comes an MCP server for your pipeline, a worked example that lets Claude Code search your documents and act on live data.

Open the repository on GitHub

Learn it from a worked example: /teach-me

Type /teach-me and Claude picks your next exercise, writes a worked solution and opens it as a lesson in a VS Code tab: the code, with a number on each line that teaches something and a note under it for each number. Read it, close it, and write the exercise yourself from memory.

A VS Code tab titled Preview 01-strings.md: the worked solution for exercise 1 with circled numbers one to five in comments at the ends of its lines, and under it five notes, each starting with its number, on text.split(), join, len with less-than-or-equal, slicing and f-strings.
The lesson for exercise 1. Each number in the code is the note of the same number below it.

Type /check when you are done. Claude runs the exercise's tests and gives you a score, then each failure: what went in, what was expected and what came back, the line in your file that caused it, and the note in the lesson that covers it. Then it asks whether to start again from a blank file, and you write it again until every test passes. Writing it from memory, not copying, is what makes it stick.

The Claude Code panel after /check: the tests ran, 4 failed and 2 passed, score 2 of 6. One bullet points at solution.py line 2, split with a space splitting on single spaces only; another at line 6, less-than treating text of exactly n characters as cut. It ends: Restart this exercise from scratch?
/check on an attempt with two common mistakes: split(" ") for split(), and < for <=.
The /teach-me loop: Claude writes a worked solution, you read the lesson, write it from memory, and /check scores it; if a test fails you restart from a blank file, and when every test passes the exercise is done and goes on your review list. /teach-meClaude writes a worked solution Read the lessonA VS Code tab, a note per numbered line Write it from memoryIn solution.py, with the lesson closed /checkThe tests run: a score and each mistake Every test passes? PassedOn your review list; next exercise No: restart from a blank file yes
The loop. You write the exercise from memory until every test passes; the lesson stays one click away.

Each exercise you pass goes on your review list: every few exercises, /teach-me brings one back for you to solve again from memory, with no lesson.

See how far you are: /progress

Type /progress and Claude opens your map in a VS Code tab: one square per exercise, a row per module, from Python basics to the final project. Passed exercises are lit, the one you are on is outlined, and the counter says how many of the fifty you have done. It updates every time /check passes one, so you can leave the tab open.

The progress map after nine exercises: a dark panel titled Your path to a RAG pipeline, with 9 of 50 exercises in amber at the top right and Now: 10-pydantic, Types under it. Rows of numbered squares, one row per module from Syntax and data to Final project: exercises 1 to 9 lit amber with a check mark after the finished first row, exercise 10 outlined, the rest dark, and a last dashed row for the MCP server.
The map after nine exercises. The last row is the MCP server, which comes after the final project.

After the last exercise: an MCP server for your pipeline

MCP, the Model Context Protocol, is the standard way to give an AI assistant like Claude Code new tools and data. You write a small server; Claude Code connects to it and can then call its tools, read its documents and use its prompts.

The repository ends with a complete one, written in Python with FastMCP: a document search over the final project's documents (a ferry company's fares and rules) and a small live booking system, so Claude Code can answer "Can I take my dog on the ferry?" from the documents and "Move my booking to the last sailing today" against live data. It runs offline, with no key. It is a worked example to read and run, not a graded exercise; /teach-me walks you through it after the final project, and the map's last square lights when you have.

What it shows you:

  • Tools, resources and prompts, and who chooses each: the model, the app or the user.
  • A search tool whose description is written for the model, beside tools that read and change live data.
  • Running over stdio on your own machine and over HTTP, with sign-in and per-user access checked in code.
  • Asking the user to confirm before a change, and a long job that returns at once.
  • Testing a server through a real client.

Add it to Claude Code from the repository's folder with one line, then ask it a question:

claude mcp add ferry -- uv run --directory "$PWD" python examples/mcp-server/server.py

Read the MCP server on GitHub