HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
norvig
pytudes
Jupyter Notebook2017–2026
norvig / pytudes

pytudes

Python programs, usually short, of considerable difficulty, to perfect particular skills.

79Distinct people
101Mentions
2Explicit recommenders
24.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Python programs, usually short, of considerable difficulty, to perfect particular skills.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I love how lightweight and interactive this is. Related: Norvig's runnable intro probability notebooks at https://github.com/norvig/pytudes#pytudes-index-of-jupyter-i...

abecedarius used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 8:59:02 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year101 dated mentions

Observed mentions: 2017-06-05 20:42:41 UTC to 2026-09-17 02:41:35 UTC.

051015202017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 9 mentions; 3 submissions, 6 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 13 mentions; 2 submissions, 11 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 7 mentions; 3 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 13 mentions; 6 submissions, 7 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 22 mentions; 12 submissions, 10 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 16 mentions; 3 submissions, 13 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 4 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 3 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 3 mentions; 3 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC936
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC13211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC734
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC312
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC1367
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC221210
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC16313
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC844
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC734
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC330

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Peter Norvig MIT License 2015-2026 pytudes "An étude (a French word meaning study) is an instrumental musical composition, usually short, of considerable difficulty, and designed to provide practice material for perfecting a particular musical skill." — Wikipedia This project contains pytudes—Python programs, usually short, for perfecting particular programming skills. Who is this for? To continue the musical analogy, some people think of programming like Spotify: they want to know how to install the app, find a good playlist, and hit the "play" button; after that they don't want to think about it. There are plenty of other tutorials that will tell you how to do the equivalent of that for various programming tasks—this one won't help. But if you think of programming like playing the piano—a craft that can take years to perfect—then I hope this collection can help. Index of Jupyter (IPython) Notebooks For each notebook you can hover on the title to see a description, or click the title to view on github, or click one of the letters in the left column to open the notebook on colab or nbviewer. Open Year New co nb 2026 (How to Write a (Lisp) Interpreter (in Python)) co nb 2026 Approximating Pi with a Fraction co nb 2026 Did you solve it? R y clvr ngh t rd ths sntnc? co nb 2026 Integer Palindromes co nb 2026 Largest prime factor co nb 2026 Project Euler #1–100 by Fable LLM co nb 2026 Project Euler #1–100 by Kimi LLM co nb 2026 Project Euler #1–100 by Opus LLM co nb 2026 Project Euler #1–100 by a Human co nb 2026 Truncatable Primes co nb 2025 Advent of Code 2025 co nb 2025 Advent of Code 2025: AI LLM Edition Open Year Large Language Models co nb 2022 AlphaCode Automated Programming co nb 2025 Advent of Code 2025: AI LLM Edition co nb 2019 Effectiveness of Language Models co nb 2018 How to Do Things with Words: NLP in Python co nb 2026 Integer Palindromes co nb 2024 The Languages of English, Math, and Programming co nb 2024 LLMs, Theory of Mind, and Cheryl's Birthday co nb 2023 One Letter Off co nb 2026 Project Euler #1–100 by a Human co nb 2026 Project Euler #1–100 by Fable LLM co nb 2026 Project Euler #1–100 by Opus LLM co nb 2026 Project Euler #1–100 by Kimi LLM Open Year Programming Examples co nb 2026 Approximating Pi with a Fraction co nb 2022 The Babylonian Number System co nb 2018 Beal's Conjecture Revisited co nb 2020 Bicycling Statistics co nb 2018 Can't Stop co nb 2019 Chaos with Triangles co nb 2017 Conway's Game of Life co nb 2020 Generating and Solving Mazes co nb 2026 Largest prime factor co nb 2021 Mel's Konane Board co nb 2020 Photo Focal Lengths co nb 2018 Pickleball Tournament co nb 2022 Selecting Names from a Menu co nb 2020 Tracking Polls: Electoral Votes Open Year Advent of Code co nb 2025 Advent of Code 2025: AI LLM Edition co nb 2025 Advent of Code 2025 co nb 2024 Advent of Code 2024 co nb 2023 Advent of Code 2023 co nb 2022 Advent of Code 2022 co nb 2021 Advent of Code 2021 co nb 2020 Advent of Code 2020 co nb 2018 Advent of Code 2018 co nb 2017 Advent of Code 2017 co nb 2016 Advent of Code 2016 co nb 2022 Advent of Code Utilities Open Year Probability and Uncertainty co nb 2018 A Concrete Introduction to Probability co nb 2016 Probability, Paradox, and the Reasonable Person Principle co nb 2020 Estimating Probabilities with Simulations co nb 2023 The Diamond Game: A Probability Puzzle co nb 2019 The Devil and the Coin Flip Game co nb 2020 Dice Baseball co nb 2018 Economics Simulation co nb 2024 Overtime in American Football co nb 2012 Poker Hand Ranking co nb 2020 The Unfinished Game .... of Risk co nb 2019 WWW: Who Will Win (NBA Title)? Open Year Logic and Number/Counting Puzzles co nb 2024 Counting Cluster Sizes in Paint by Numbers co nb 2014 Cryptarithmetic co nb 2018 Euler's Sum of Powers Conjecture co nb 2020 Four 4s, Five 5s, and Countdowns co nb 2020 How to Count Things co nb 2024 Number Bracelets Game co nb 2019 Pairing Socks co nb 2018 Sicherman Dice co nb 2014 Sol Golomb's Rectangle Puzzle co nb 2024 Stubborn number endings co nb 2020 Square Sum Chain Puzzle co nb 2020 When is Cheryl's Birthday? co nb 2015 When Cheryl Met Eve: A Birthday Story co nb 2015 xkcd 1313: Regex Golf co nb 2015 xkcd 1313: Regex Golf (Part 2: Infinite Problems) Open Year Sudoku and Similar Puzzles co nb 2006 Sudoku co nb 2021 Sudoku: 400,000 puzzles/second in Java co nb 2021 KenKen (Sudoku-like Puzzle) co nb 2021 Star Battle (Sudoku-like Puzzle) Open Year Word Puzzles co nb 2020 Boggle / Inverse Boggle co nb 2020 Chemical Element Spelling co nb 2026 Did you solve it? R y clvr ngh t rd ths sntnc? co nb 2020 Equilength Numbers: FOUR = 4 co nb 2017 Gesture Typing co nb 2017 Ghost: A Word game co nb 2015 Let's Code About Bike Locks co nb 2017 Scrabble: Refactoring a Crossword Game Program co nb 2020 Spelling Bee co nb 2017 Translating English into Propositional Logic co nb 2020 Wordle, Evil Wordle, Antiwordle, and Jotto co nb 2022 Winning Wordle co nb 2017 World's Longest Palindrome co nb 2020 World's Shortest Portmantout Word co nb 2018 xkcd 1970: Name Dominoes Open Year The Riddler (from 538) co nb 2022 Anigrams: Word Chains co nb 2017 Battle Royale co nb 2021 Climbing Wall co nb 2021 CrossProduct co nb 2020 Flipping Cards; A Guessing Game co nb 2019 Lottery co nb 2019 How Many Soldiers to Beat the Night King? co nb 2017 Misanthropic Neighbors co nb 2018 Properly Organized Card Hands co nb 2021 Race Track co nb 2021 Split the States co nb 2020 Tour de 538 co nb 2020 Weighing Twelve Balls co nb 2020 War. What is it Good For? Open Year Computer Science Algorithms and Concepts co nb 2017 BASIC Interpreter co nb 2017 Convex Hull Problem co nb 2026 (How to Write a (Lisp) Interpreter (in Python))
Read the full README on GitHub

What Hacker News says

16 sources
da39a3ee·Nov 8, 2023Submission

Ask HN: How to deal with the short vs. long function argument

I've been a programmer for 25 years. A realization that has crept up on me in the last 5 is that not everyone thinks that functions should be short: there are two cultures, with substantial numbers of excellent programmers belonging to both. My question is: how do we maintain harmonious, happy, and productive teams when people can disagree strongly about this issue? The short-functions camp holds that functions should be short, tend toward the declarative, and use abstraction/implementation-hiding to increase readability (i.e. separable subsections of the function body should often be broken out into well-named helper functions). As an example, look at Peter Norvig's beautiful https://github.com/norvig/pytudes. For a long time I thought that this was how all "good programmers" thought code should be written. Personally, I spent over a dec
Read the rest
ade writing in a dynamic and untyped language, and the only way that I and my colleagues could make that stuff reliable was to write code adhering to the tenets of the short-function camp. The long-functions camp is, admittedly, alien to me, but I'll try to play devil's advocate and describe it as I think its advocates would. It holds that lots of helper functions are artificial, and actually make it _harder_ to read and understand the code. They say that they like "having lots of context", i.e. seeing all the implementation in one long procedural flow, even though the local variables fall into non-interacting subsets that don't need to be in the same scope. They hold that helper functions destroy the linear flow of the logic, and that they should typically not be created unless there are multiple call sites. The short-function camp also claims an advantage regarding testability. Obviously languages play a major role in this debate: e.g. as mentioned above, untyped dynamic languages encourage short functions, and languages where static compilation makes strong guarantees regarding semantics at least make the long-function position more defensible. Expression-oriented and FP-influenced languages encourage short functions. But it's not obvious, e.g. Rust could go both ways based on the criteria just mentioned. Anyway, more qualified people could and have written at much greater length about the topic. The questions I'm asking are - Is it "just a matter of taste", or is this actually a more serious matter where there is often an objective reason for discouraging the practices of one or other camp? - How can members of the different camps get along harmoniously in the same team and the same codebase?
5 points · Open discussion
I have the same impression. Reading the code, he uses global variables [1], obscure variable (k, bw, fw, x) and module names ("pal.py" instead of "palindromes.py"), doesn’t respect conventions about naming in general (uppercase arguments [2], which even the GitHub syntax highlighter is confused about). This feels like code you write for yourself to play with Python and don’t plan to read later. Some parts of the code feel like what I would expect from a junior dev who started learning the language a couple weeks ago. [1]: https://github.com/norvig/pytudes/blob/952675ffc70f3632e70a7... [2]: https://github.com/norvig/pytudes/blob/952675ffc70f3632e70a7...
In Pytudes
Prolog is excellent for bikeshedding, in fact that might be its strongest axis. It starts with everything you get in a normal language such as naming things, indentation, functional purity vs side effects, where to break code into different files and builds on that with having your names try to make sense in declarative, relational, logical and imperative contexts, having your predicates (functions) usable in all modes - and then performant in all modes - having your code be deterministic, and then deterministic in all modes. Being 50 years old there are five decades of learning "idiomatic Prolog" ideas to choose from, and five decades of footguns pointing at your two feet; it has tabling, label(l)ing, SLD and SLG resolution to choose from. Built in constraint solvers are excellent at tempting you into thinking your problem will be well s
Read the rest
olved by the constraint solvers (it won't be, you idiot, why did you think that was a constraint problem?), two different kinds of arithmetic - one which works but is bad and one which mostly works on integers but clashes with the Prolog solver - and enough metaprogramming that you can build castles in the sky which are very hard to debug instead of real castles. But wait, there's more! Declarative context grammars let you add the fun of left-recursive parsing problems to all your tasks, while attributed variables allow the Prolog engine to break your code behind the scenes in new and interesting ways, plenty of special syntax not to be sneezed at (-->; [_|[]] {}\[]>>() \X^+() =.. #<==> atchoo (bless you)), a delightful deep-rooted schism between text as linked lists of character codes or text as linked lists of character atoms, and always the ISO-Standard-Sword of Damocles hanging over your head as you look at the vast array of slightly-incompatible implementations with no widely accepted CPython-like-dominant-default. Somewhere hiding in there is a language with enough flexibility and metaprogramming to let your meat brain stretch as far as you want, enough cyborg attachments to augment you beyond plain human, enough spells and rituals to conjour tentacled seamonsters with excellent logic ability from the cold Atlantic deeps to intimidate your problem into submission. Which you, dear programmer, can learn to wield up to the advanced level of a toddler in a machine shop in a mere couple of handfuls of long years! Expertise may take a few lifetimes longer - in the meantime have you noticed your code isn't pure, doesn't work in all modes, isn't performant in several modes, isn't using the preferred idiom style, is non-deterministic, can't be used to generate as well as test, falls into a left-recursive endless search after the first result, isn't compatible with other Prolog Systems, and your predicates are poorly named and you use the builtin database which is temptingly convenient but absolutely verboten? Plenty for you to be getting on with, back to the drawing boar...bikeshed with you. And, cut! No, don't cut; OK, green cuts but not red cuts and I hope you aren't colourblind. Next up, coroutines, freeze, PEngines, and the second 90%. Visit https://www.metalevel.at/prolog and marvel as a master deftly disecting problems, in the same way you marvel at Peter Norvig's Pytudes https://github.com/norvig/pytudes , and sob as the wonders turn to clay in your ordinary hands. Luckily it has a squeaky little brute force searcher, dutifully headbutting every wall as it explores all the corners of your problem on its eventual way to an answer, which you can always rely on. And with that it's almost like any other high level mostly-interpreted dynamic programming / scripting language.
In Using Prolog in Windows NT Network Configuration (1996)
I think it depends a lot on what your git repository is. If it's specifically source code for anything that's intended to run, then avoiding including the outputs is a smart move. But then, if that's the case, there's a good chance you'd just be committing a .py file. I like notebooks because they include output alongisde input. For example, Peter Norvig's Pytudes are all brilliant, quick notebooks that solve a particular puzzle[0]. The code itself might not be that interesting to run (unless you really want to confirm his strategy for wordle checks out) but reading through the notebooks makes for a great experience of simultaneously understanding his thought process, and seeing the solution. I do a bunch of generative art stuff and have recently been experimenting with using notebooks as quick sketches[1]. I really like the workflow and
Read the rest
end up with something like a journal that isn't necessarily intended to be ran repeatedly, but read over, where I can see the visual output created, as well as the method for it. [0] Norvig's extremely cool pytudes, wordle example: https://github.com/norvig/pytudes/blob/main/ipynb/Wordle.ipy... [1] My not anywhere near as cool as Norvig's pytudes example: https://github.com/benrutter/jupyter-sketches
In Git and Jupyter Notebooks Guide
Read the rest
sf (ex of functional OOP) https://github.com/r-spatial/sf Ruby * Sequel https://github.com/jeremyevans/sequel/ * Sidekiq https://github.com/sidekiq/sidekiq Rust * ripgrep https://github.com/BurntSushi/ripgrep Scala * fs2 (ex of good type safety) https://github.com/typelevel/fs2 * monix (ex of ugly code with great performance) https://github.com/monix/monix TypeScript * GitHub Desktop (ex of SPA) https://github.com/desktop/desktop --- thanks to: cejast, bb86754, wewxjfq, antonyt, bit, diego_moita, agjmills, freedomben, Contortion, valenterry, DethNinja, mberning, seneca
In Ask HN: What are some of the most elegant codebases in your favorite language?
How exactly do you use clojure's repl? You're not supposed to write things in the repl window. As for functional programming, if your rebuttal is that python has list comprehensions, you still need to do some more digging into it. I suggest you read Peter Norvig's pytudes, he writes python in a functional way and uses both higher order functions (which are there, but really meh) and list comprehensions. They are not the same thing. Clojure also has immutable structures which is imo just as important for functional programming. Not to say that python can't be used for it (pytudes really looks like art). For clojure maybe you can watch the parent of the dead series on YouTube (there's an ongoing reboot of the series). The repl workflow is so different from other languages that you really need to see people code in clojure live to understand
Read the rest
In REBL

Showing the 15 most recent of 16 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.