Python

从思维模型到 DSA 模式的 Python。12 节课,5 个阶段 — 每个代码块都通过 Pyodide 在你的浏览器中运行。

阶段 0

基础

  1. 🐍 #0 欢迎 + Python 心智模型 Python 如何执行代码,以及缩进为何如此重要
  2. 🏷️ #1 变量、类型与输入/输出 名字、类型转换与用户输入
  3. ⚖️ #2 运算符 + 布尔逻辑 比较、身份与真值
阶段 1

Python 核心

  1. 🧭 #3 控制流 if/elif/else、for、while
  2. 🧩 #4 函数 + 作用域 可复用的逻辑与整洁的代码
  3. 🧰 #11 Python 核心(进阶) 迭代器、生成器、异常、文件、模块
阶段 2

数据结构

  1. 🧵 #5 字符串 + 文本处理 不可变性、切片、格式化与方法
  2. 📦 #6 列表 + 元组 有序集合与必备方法
  3. 🧩 #7 集合 唯一性 + 快速成员检测
  4. 🗺️ #8 字典 键值映射、方法与内部机制
阶段 3

问题求解

  1. 🧠 #9 复杂度 + 内存模型 大 O、可变性与拷贝
阶段 4

面向对象 + 实战

  1. 🏗️ #10 数据结构与算法模式 + 面向对象 + 实战 双指针、前缀和与整洁的设计

Python

Learn Python by editing live examples in the browser, from first ideas to data-structure patterns.

A browser-based Python curriculum organized into ordered phases of lessons, from mental model up through data-structures-and-algorithms patterns. Every code block on every lesson page is editable and runnable in place via Pyodide, so the runtime is the same CPython semantics you'd get locally, just compiled to WebAssembly.

The Pyodide runtime is ~10 MB and downloads lazily on the first Run click, then caches for the session. The site started as a Rust+WASM curriculum before being ported to Astro+MDX in May 2026; the REPL was retrofitted onto every lesson a few days later. Start at lesson 1 or jump into the glossary.