Use Peter Norvig's collection if you already write Python and want to study how someone else decomposes a problem. Skip it if you need a guided first programming course or reusable algorithms whose behavior on arbitrary inputs you can take on trust. The README describes programming practice, and an Advent of Code issue identifies a solution with a narrower input range.
Pytudes is Peter Norvig's collection of Python programming studies, published as notebooks and scripts under the MIT license. A notebook combines explanation, code and recorded output on one page. That format lets you follow the choices leading to a solution, rather than seeing only its final function. The repository index includes probability, word games, interpreters and classic algorithms. Choose a problem you want to understand before choosing a setup method.
What people use pytudes for
You can study Python solutions to problems such as Sudoku, spelling correction, probability and interpreter design in the README's subject index. The practical attraction is access to the reasoning around code: what the problem means, which representation makes it manageable, and how smaller operations combine into a solution. Treat the collection as material for close reading. You don't have to turn every notebook into a runnable local project to begin learning from it.
For a first visit, pick one familiar problem. The README explicitly labels Largest prime factor as a beginner entry. If you already understand the puzzle, you can spend your attention on the program. For a second visit, choose something outside your usual work, perhaps a Lisp interpreter or a probability exercise. Our recommendation is to write down the representation and helper functions before copying code: those are the choices you can compare with your own solution.
Readers describe learning decomposition and understanding unfamiliar ideas, rather than deploying pytudes as an application. These are individual accounts, with different starting points; they give you concrete ways to use the collection without promising a measured improvement in your own skills.
- Hacker News commenter mark_l_watson found the bottom-up solutions educational. He contrasted Norvig's low-level utilities with his own tendency to write small Python monoliths while working in deep learning. His stated intention was to change how he used Python.
- canvascritic discovered pytudes during LeetCode practice and reported moments of understanding. The same commenter credited Norvig's spelling-corrector explanation with making Bayesian probability concrete earlier in their career. That is a reader's learning experience, rather than a controlled comparison with a course.
- GitHub participant vismit2000 returned daily to the Advent of Code 2025 notebook, praising its concise solutions, visualizations and accompanying AI notebook. They also raised the Day 9 input limitation. Enjoying an explanation and questioning its algorithm can happen together.
- The fast.ai learning-resources wiki recommends pytudes to intermediate programmers, particularly for breaking problems into clear code. That placement is a useful starting point if you know the language but struggle to organize a solution.
- GitHub user willcodefortea published an explicitly inspired collection, with Advent of Code notebooks and a Mars Rover kata. You can use Norvig's format as a prompt to keep your own problem-solving notebook, rather than only accumulating someone else's answers.
What happened when we ran it
Our measurement method was a sandbox repository run at commit 21dfdbd on November 28, 2026, separating installation, build and test steps. The build's last visible diagnostic names ./py/docex.py:59 and says SyntaxWarning: invalid escape sequence '\s'. It identifies a warning in a docstring, but gives no causal explanation for the failed command. Blaming a dependency or a particular Python version would go beyond that log.
| Sandbox observation | Recorded result |
|---|---|
| Installation | Succeeded in 4 seconds |
| Dependencies and installed disk use | 44 dependencies recorded; 174 MB on disk |
| Build | Failed, exit 1, in 1 second |
| Tests | No tests script or target; skipped |
| Checkout | 227 files; approximately 5,018 source lines; 197.1 MB |
| Repository signals | 1 CI workflow file; no Dockerfile; no tests directory |
| Sandbox configuration | 3 CPUs; 8 GB RAM; image label ghcr.io/astral-sh/uv:python3.12-bookworm |
A successful dependency installation did not get this checkout through the build step. Equally, the skipped test step supplies no pass or fail result for individual notebooks. A missing tests directory means exactly that: it is not evidence that the collection contains no assertions or example checks. The image label records the requested sandbox configuration; the actual runtime and operating-system versions require the raw toolchain logs.
The separate application-deployment check stopped earlier. Its safety step failed because no Compose file existed: it looked for compose.yaml, compose.yml, docker-compose.yaml and docker-compose.yml. That runner required Compose. This is a mismatch between the runner's rule and a collection of programming studies, not a demonstrated notebook execution failure.
There is a contradictory run-summary entry claiming deployment with its own Docker Compose, including ports bound to 127.0.0.1. The failed prerequisite prevents us from treating that summary as proof of a live deployment. No completed application task follows the safety check.
Where people get stuck: old examples and missing inputs
Historical reports identify different kinds of obstacles: a Python compatibility change, an unavailable input file, and a deliberately smaller interpreter. Their remedies differ. Use the filename and exception to choose a path, rather than applying one repository-wide fix.
| Report | What the participant encountered | Resolution shown in the thread |
|---|---|---|
| Issue #34 | A reader running How to Do Things with Words hit NameError at file('big.txt') and needed the text file. |
The reporter proposed open() and obtained big.txt; the issue was closed after PR #50 merged. |
| Issue #53 | A quoted string containing spaces failed in lis.py. |
Norvig explained that lis.py supports symbols, lists and numbers; lispy.py supports strings. This is a capability distinction. |
| Issue #63 | Readers hit FileNotFoundError for data/advent2018/input1.txt. |
Closed after the reporter's "never mind" reply, with no documented repair. |
| Issue #62 | A reader reported unpacking and unhashable-list errors while loading count_1w.txt. |
Norvig said he could not reproduce them and that changed code seemed to work. The original cause is absent. |
| Issue #1 | A reader reported an assertion failure followed by a Sudoku KeyError. |
Norvig said there was a data error and that he fixed it. |
These reports reward reading the final maintainer reply. In #53, editing the tokenizer to preserve spaces would miss Norvig's explanation: the smaller interpreter does not implement strings. In #63, a closed status gives you no recipe for obtaining the missing puzzle input. Start by reading the selected notebook's imports and file paths, then decide whether you want to reproduce that example or just study its approach.
Compact Python divides readers over maintainability
Hacker News readers disagree about short names, globals and one-line functions in pytudes. In the 2021 discussion, wirthjason found the departure from familiar conventions instructive, while globular-toast objected to it in professional code. One example was assigning the string-joining method to cat. It makes an operation concise, but a colleague still has to learn what that name means.
The 2023 discussion is more specific. hk__2 objected to obscure names and naming conventions; fsociety defended short educational examples whose expected maintenance differs from an enterprise application. Other participants defended module-level state and functional programming, meaning code organized around functions and their composition. None of those opinions settles how your team should write Python.
Our advice is to separate the representation from the naming convention. You can borrow how an example divides a problem while giving the resulting functions names your colleagues already understand. If a compact expression takes you longer to explain than an expanded version, keep the expanded version in your own work. The exercise is understanding the choice, including when you would choose differently.
Recent repository activity does not certify every example
GitHub reports a last push on November 28, 2026, alongside 24,438 stars and 32 open issues and PRs in the metadata fetched for this review. The discussion in issue #144 still contains an open algorithmic limitation and a request for another solution. Read those signals together: the repository has recent activity, and a reader can still encounter an example whose scope needs attention. Stars measure interest, not classroom use, learning gains or deployment.
A puzzle solution can depend on the shape of its input
Issue #144 quotes Norvig saying the Advent of Code 2025 Day 9 solution works for his input but not every possible input, particularly a highly non-convex shape. That is a specific algorithmic boundary in a discussion opened by an appreciative reader. It is more useful than a broad label such as "expert code": you can admire the explanation and still need a different method for a wider problem.
The participant proposes Shapely and coordinate compression with a prefix-sum array as approaches covering all inputs. Coordinate compression replaces widely spaced coordinates with a smaller indexed representation; a prefix-sum array helps answer region-sum queries from precomputed totals. Their generality is the participant's claim, not a result from our sandbox. The same open thread asks for a missing Advent of Code 2018 Day 23 solution, with no solution supplied in the conversation.
For your own adaptation, write down the input assumptions before choosing an algorithm. "It solved this puzzle instance" and "it handles every shape my program accepts" require different checks. Day 9 gives you a concrete example of why that question belongs beside the code.
Pytudes vs structured courses and Advent of Code megathreads
Choose pytudes for self-directed reading; choose a course when you want a sequence, and a solution thread when you want several approaches to one puzzle. These choices follow the distinctions readers make, rather than a speed or learning-outcome comparison.
| Option | Why someone would choose it | What supports the distinction |
|---|---|---|
| Pytudes | Follow Norvig's presentation of a selected problem. | The README organizes notebooks by topic and describes programming practice. |
| Advent of Code solution megathreads | Compare different people's approaches to the same day. | Hacker News commenter uyt links the megathreads, while personally preferring Norvig's readability and craftsmanship. |
| A structured course | Follow progressive lessons and feedback instead of selecting your own studies. | Starlog recommends courses for readers who need guided progression. |
| Design of Computer Programs | Explore Norvig's teaching through puzzle programs. | The README recommends the Udacity course by name. |
The megathread preference belongs to uyt, rather than proving that competing solutions are generally worse. Starlog's course distinction is useful even though some of its technical descriptions need correction. The README names Design of Computer Programs; the course and a repository of studies answer different needs.
Two other repositories make useful companions. TeoZosa/pytudes organizes challenges under problem-source namespaces, such as LeetCode, and describes solutions informed by existing implementations. willcodefortea/pytudes lists Advent of Code work and a Mars Rover kata. Pick either for those particular study materials, rather than assuming that every project named pytudes is maintained by Norvig.
What the other reviews get wrong
Starlog's isolation claim overlooks the shared supporting material linked from Norvig's README. Its review says each notebook is intentionally isolated and suggests readers cannot build on previous solutions. The README explicitly links Advent of Code utility functions. Those links are enough to reject a categorical description of the collection as isolated notebooks.
Starlog also describes a vertical-bar conditional-probability interface, P(event | given), while its displayed function takes event and an optional given argument and computes an intersection inside the function. The displayed snippet does not demonstrate the interface its prose promises. Don't copy that notation on the authority of the review.
There is a separate identity problem in search results. The Read the Docs site links TeoZosa/pytudes and calls itself inspired by Norvig. Its Apache license and Poetry instructions belong to that project. Norvig's README identifies the MIT license. Check the repository owner before using similarly named documentation.
What the README gets wrong about one testimonial
The bottom-up-solutions testimonial appears under mark_l_watson in the original Hacker News thread, while the README credits Jeremey Howard. You can compare the original comment with the README's attribution. The learning observation survives that correction; the identity of the person making it changes. The fast.ai wiki's separate recommendation is its own source and should stay separate from this testimonial.
Questions people ask
Pytudes is Peter Norvig's MIT-licensed collection of Python studies, and its home is github.com/norvig/pytudes.
What is Peter Norvig's pytudes, and where is its GitHub repository?
The norvig/pytudes repository contains Python notebooks and scripts for programming practice. It is a collection to explore by problem and topic. The "pytudes norvig" and "pytudes github" searches refer to this repository; the similarly named TeoZosa project has its own documentation and workflow.
Who is pytudes for, and is it suitable for beginners?
The fast.ai wiki places pytudes under intermediate programmers, while the README marks Largest prime factor as suitable for beginners. Start there if you are newer to Python. One accessible entry does not turn the whole subject index into a progressive beginner course.
How do I run pytudes notebooks in a browser?
The README's icons open notebooks in Colab, while clicking a title opens GitHub's view. For reading when GitHub rendering fails, immortal3 recommends nbviewer. The repo2docker documentation also gives a Binder URL opening pytudes in JupyterLab's ipynb folder. Viewing a saved output and executing cells are different actions; choose the execution link when you want to change the code.
What are the long Jupyter notebooks, and how should I read them?
Hacker News commenter baq describes them as executable blog posts, in reply to someone who understood the scripts but found the notebooks confusing. Read the explanatory text alongside each code cell. Our suggested exercise is to predict the next operation before reading it, then explain what a helper function contributes to the solution.
What is new in pytudes?
The README's New in 2026 list includes approximating pi with a fraction, integer palindromes, largest prime factor, a shortest-portmantout study and truncatable primes. It also lists Project Euler work by a human and named language models. Use that dated list as the discovery point, rather than treating an older discussion's "new" as a release announcement.
Are there similar programming études for systems programming?
Hacker News user selff asked for systems-programming études, but the discussion gives no direct recommendation in response. Norvig's collection does include interpreter studies in its computer-science index. Those are Python studies, not evidence of a comparable systems-programming curriculum.
Which Norvig Udacity course are readers recommending?
The README explicitly recommends Design of Computer Programs. In the 2023 Hacker News thread, dubya suggests the same CS212 course after another reader asks which one. The README supplies the direct identification; that comment calls its identification a guess.
What license does norvig/pytudes use?
Norvig's pytudes uses the MIT license identified in its README. The Apache license on the similarly named Read the Docs site belongs to TeoZosa/pytudes. Those are separate projects.
What language is pytudes written in?
Pytudes contains Python programs in Jupyter notebooks and .py files. Jupyter Notebook describes the document format containing code, prose and output; Python is the programming language you study in the examples.
Why does How to Do Things with Words fail with a Python 3 file() NameError?
The reporter in issue #34 identified the older file() call and proposed open(). The thread records closure after PR #50 merged. Match your notebook revision to that historical report before treating its traceback as a description of today's file.
Why do older pytudes scripts report syntax errors or undefined names under Python 3?
Issue #55 records historical Python 3 checks finding older syntax and undefined names; Norvig acknowledged that everything needed updating. In issue #51, a reader reporting map's iterator behavior switched to the Python 3 interpreter on norvig.com. These are separate historical reports, not a diagnosis of our build warning.
Why does lis.py fail when a quoted string contains spaces?
Norvig says in issue #53 that lis.py does not support strings and lispy.py does. Choose the latter study when string support is part of what you want to explore.
What we have not tested yet
Our recorded run covers repository setup and a failed build, not execution of the notebook collection. We have not tested individual notebooks in Colab, Binder or local Jupyter, checked their input files one by one, or reproduced the historical issue fixes against commit 21dfdbd. The raw runtime-version logs and complete build command output are needed to establish the active toolchain and explain exit 1. The separate Compose attempt supplies no completed live task, and no screenshots accompany it.
We have not compared learning outcomes against a course, measured puzzle performance, evaluated AI-generated solutions, or reproduced the Day 9 alternative algorithms. Reader praise supplies accounts of learning, not evidence of production adoption. Our reading-path recommendations are editorial advice, not observations of an unrecorded trial.
We have not audited notebook code, dependencies, external downloads or hosted execution services for security. The failed Compose safety check says only that its required files were absent; it supplies no security verdict. For an executable notebook, inspect the cells and the data they access before granting it access to your own files or accounts.


