Programming demos#

This book collects classroom demos that accompany a first-year Python course. Each demo is self-contained, states the skills it teaches, and produces something concrete a student can keep.

Use the table below to find a demo for a specific skill, or browse the chapters in the sidebar. Every demo’s notes for teachers state its difficulty, prerequisites, and estimated setup time before you commit to it.

Skill index#

Demo

Skills

Difficulty

Vim: More than motions

Vim, bash

[*]

Looping over iterables

for-loops, flow control, string manipulation

[**]

Weather app CLI

APIs, requests, JSON, string formatting

[**]

Monte Carlo 🖌️

Simulating stochastic systems, NumPy, algorithmic thinking

[**]

ASCII tapestry

functions, loops, lists, file I/O, randomness, string formatting

[*]

Snowglobe 🖌️

Git conflict resolution, visualization

[*]

Quorum sensing in a bacterial biofilm

problem decomposition, data structure selection, function stubs, documentation

[*]

NaNoPy 3D 🖌️

NumPy, passing functions, type hinting, biomolecular simulations

[***]

Difficulty: [*] Easy, [**] Moderate, [***] Advanced. 🖌️ Uses the NaNoPy graphical environment.

The demos are maintained in a standalone repository, programming-demos, so that teachers can use them independently of this book. This appendix contains a selection of the demos from version v0.1.5.

On AI-use in this resource#

During the development of these demos, the LLM Claude Opus (5, 5.5) by Anthropic was used for various tasks via the Claude Code interface. In all cases, the output of the LLM was reviewed by the author.

Formatting & layout#

The structural elements of figures and design features such as dropdown boxes were placed by a coding agent. This involved the placement of appropriate fences to separate structural elements from text, as well as syntax for correct formatting of figure placement, size, caption, and alt text.

Figure alt text & captions#

Some figure alt text was applied by the coding agent and not adapted if it was correct (descriptive) and succinct. A high level of scrutiny was applied to captions inserted by the coding agent. These were adapted by the author to ensure correctness and meaningfulness.

Code#

Alignment of code to demo text. The code presented to students in the form of templates contains comments with instructions. The development cycle of the demos required aligning the content of the Python files to the content of the demo text. This was done either by hand or by a coding agent and involved summarizing the demo tasks from the text in a concise format. This also holds for reordering tasks described and adapting details like numbers to match the demo text.

Prototyping. At the early stages of demo development, some of the demo scripts were generated by a coding agent to test the feasibility of the demo before committing significant time. If this was the case, these were later adapted by the author to suit the format of the demos and the level of programming appropriate for beginning Python programmers.

Refactoring of code. The snowglobe demo was initially written by hand in a function-centric design pattern. A coding agent was used to restructure the code to use fewer functions.

Outlining#

A coding agent was used as a brainstorming partner during the outlining phase of the demos. This involved:

File creation. A majority of the markdown files were first scaffolded with placeholders using a coding agent in order to get an idea of the structure of the book.

Headings. During the scaffolding process, headings were placed according to the brainstorming process of the author.

Large-scale edits#

Edits to the global structure of the demos were sometimes made using a coding agent. Examples of this include: restructuring all demos to have the structure index, notes for teachers, demo text; Managing the_toc.yml file; Changing the difficulty format from beginner, intermediate, advanced to the star-system present now.

Infrastructure#

Each demo provides files for teachers to distribute to students. Different versions of these files (templates, solutions) are contained in a table on the Notes for teachers page. The repository contains infrastructure to ensure that each file has a single source of truth regarding version. This avoids having to make the same edit in multiple file versions when adapting the demo text. The system for file assembly was developed primarily using a coding agent.

Images#

If not otherwise labeled, the images presented in this resource were created by the author and not by AI.

Content#

Teacher-facing and student-facing text was primarily written by the author, see below for exceptions:

Review and suggestions. A coding agent was used to review the text for grammatical correctness, flow, and clarity. This involved taking some of the suggestions provided by the coding agent into account during the editing process of the book.

Bullet points. During the brainstorming process explained above, the coding agent would place bullet points containing instructions provided by the author about the content and structure of different sections. This can be seen in the commit history of this repository.

Boilerplate text on teacher-facing pages. Each demo contains a table with files to be distributed to students. The table and its caption were primarily created and managed by the coding agent during the development process.