pytudes
Python programs, usually short, of considerable difficulty, to perfect particular skills.
Pytudes is Peter Norvig's personal collection of Python programming exercises in Jupyter Notebooks, covering math puzzles, AI problems, and coding challenges written to demonstrate expert-level Python craft.
Pytudes is a personal collection of Python programming exercises created by Peter Norvig, a renowned AI researcher and former Google research director. The name is a play on "etude" — a French word for a musical study piece designed to develop technique — applied to programming. Just as a pianist practices etudes to sharpen specific skills, these are Python programs written to practice and demonstrate programming craft.
The collection is primarily Jupyter Notebooks, which are interactive documents that combine code, explanations, and results all in one readable file. Each notebook tackles a self-contained problem: some are mathematical puzzles (like Project Euler challenges), some are logic problems, some explore AI and language model behavior, and many are solved puzzles from Advent of Code (an annual programming challenge event in December). Topics range from prime number theory to word games to probability simulations.
This is not a tutorial for beginners. As the author notes, it's for people who think of programming like playing an instrument — a craft requiring years of deliberate practice. Intermediate to advanced Python programmers would use this as a source of inspiration, as a study in elegant problem-solving, or to see how an expert approaches hard puzzles with clean, concise Python code. The notebooks are runnable in the browser via platforms like Google Colab, requiring no local setup. The language is Python 3.
Where it fits
- Study expert-level Python problem-solving by reading and running Norvig's annotated solutions to classic puzzles.
- Use a specific notebook as a reference when tackling a similar math, logic, or probability problem in your own code.
- Practice advanced Python by running Advent of Code solutions and adapting them to different inputs.
- Explore how an AI researcher approaches language model and probability problems with concise, elegant Python.