pytudes README

项目的 README,来自 github.com/norvig/pytudes。合并为一个 markdown 文件:README.md。

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, providing practice pieces for perfecting particular programming prowess.

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

Click a title to see a notebook on GitHub, or click the [colab] icon next to it to run it in Colab[colab]. Hover over a title to see the full name, year, and a description.

🆕 New in 2026

🤖 Large Language Models

🎲 Probability and Uncertainty

🎄 Advent of Code (Problems from adventofcode.com)

🌉 Project Euler (Problems from projecteuler.net)

🧩 Logic and Number Puzzles

🔢 Grid Puzzles and Board Games

🔠 Word Games and Puzzles

🧠 The Riddler and xkcd

💻 Computer Science

📊 Data and Simulation

Index of Python Files

File Description Documentation
beal.py Search for counterexamples to Beal's Conjecture documentation
docex.py An obsolete framework for running unit tests, similar to doctest
ibol.py An Exercise in Species Barcoding documentation
lettercount.py Convert Google Ngram Counts to Letter Counts documentation
lis.py Lisp Interpreter written in Python documentation
lispy.py Even Better Lisp Interpreter written in Python documentation
lispytest.py Tests for Lisp Interpreters
pal.py Find long palindromes documentation
pal2.py Find longer palindromes documentation
pal3.py Find even longer palindromes documentation
pytudes.py Pre-process text to generate this README.md file.
py2html.py Pretty-printer to format Python files as html
SET.py Analyze the card game SET documentation
spell.py Spelling corrector documentation
sudoku.py Program to solve sudoku puzzles documentation
testaccum.py Tests for my failed Python accumulation display proposal documentation
yaptu.py Yet Another Python Templating Utility

Etudes for Programmers

I got the idea for the "etudes" part of the name from this 1978 book by Charles Wetherell that was very influential to me when I was first learning to program. I still have my copy, but it is now easier to find a pdf than a hard copy.

Reviews of pytudes

Here's what some people are saying about pytudes:

pytudes (norvig/pytudes)

正在搜索数据库…

这是什么?Pytudes 是 Peter Norvig 的个人作品集,收录了一系列短小而刻意设计得很难的 Python 程序和 Jupyter 笔记本。每一个都是为了打磨某项特定的编程技能而写的,名字借鉴了音乐中的练习曲。
这是我可以导入的库,还是一组独立的笔记本?它不是库,而是一份索引,列出了几十个相互独立的 Jupyter 笔记本和普通 .py 脚本。每个都针对一个谜题或算法,需要单独打开使用,而不是导入。
我该如何使用这些笔记本?从 README 的索引表格中选一个条目,点击其 “co” 链接即可在 Google Colab 中打开,或点击 “nb” 在 nbviewer/GitHub 上查看;也可以直接克隆仓库,运行 .py 文件。
运行它们需要什么?只需要 Python 3;如果是笔记本,还需要 Jupyter,或者通过 Google Colab 在浏览器中运行。仓库没有声明额外的 pip 依赖,也没有提供 Dockerfile。
这是适合新手的分步教程吗?不是。Norvig 明确将它与“安装即上手”的教程区分开来:它面向的是愿意把编程当作需要多年磨练的手艺的人,而不是快速浏览式的入门指南。
“pytudes”这个名字有什么来历?这个名字由 “Python” 和 “étude”(练习曲,指为打磨某项特定技能而写的短篇乐曲)组合而成。Norvig 把同样的理念应用到了编程练习上。
它包含 Advent of Code 的内容吗?包含。它提供了 2016 年至 2025 年 Advent of Code 的解法,其中包括一个 2025 年的 “AI LLM Edition” 笔记本,用于比较 LLM 生成的解法。
有没有对比人类与 AI 解题的笔记本?有。一组 2026 年的笔记本分别由人工解答,以及由 Fable、Kimi、Opus 三个 LLM 解答 Project Euler 第 1 至 100 题,以便对比。
除了谜题,它还涵盖哪些主题?涵盖概率与不确定性、数独式逻辑谜题、文字游戏、FiveThirtyEight 的 Riddler 专栏,以及 Lisp 解释器、旅行商问题等计算机科学核心主题。
作者
norvig
大小
137 MB
星标
24.4K
更新
提交Nov 19
时长
9年
提交 · 90 天