中文

Python for K12

Self-published textbook adopted by 80+ Chinese middle schools

Python for K12 is a project by Wang Wei, Self-published textbook adopted by 80+ Chinese middle schools.

Python for K12 is a 240-page introductory Python textbook written by Wang Wei in 2022. The book draws on Wang's five years of classroom teaching at the time and was self-published in both print and PDF editions. As of 2026 it has sold approximately 18,000 copies and appears on the supplementary-reading list of more than 80 middle schools in China.

Pedagogical approach

The distinctive feature of the book is the same one that later defined Codeleaf's curriculum: every chapter pairs a coding concept with an analogy drawn from middle-school mathematics or physics. The introduction to variables uses the algebra-class concept of a labelled box; the introduction to conditionals uses the physics-class concept of a thermostat. The intent is not to teach the analogy as a literal mental model, but to give a student with no prior programming exposure a familiar starting point from which to triangulate the actual semantics.

Structure

The book is organised into twelve chapters: the first nine cover language fundamentals (variables, conditionals, loops, functions, lists, dictionaries, files, classes, and error handling); the last three are applied chapters on data manipulation, simple plotting, and a final "capstone project" chapter that walks through building a personal expense tracker end-to-end. Each chapter ends with three difficulty tiers of exercises and a one-page "why this matters in a real codebase" sidebar — a style choice that Wang has said was inspired by physics textbook Concepts of Physics (H. C. Verma).

Adoption

The textbook is widely used as supplementary reading rather than as the primary text in adopting schools. Wang has noted that this is consistent with his original design intent: the book is structured to be read on weekends or evenings as a companion to whatever official curriculum the school uses. The 80+ school adoption figure is self-reported via the publisher's order channel and has not been independently audited.

See also

References

Python for K12 — Weipedia(示例)