finds.dev← search

// the find

trekhleb/learn-python

★ 18,081 · Python · MIT · updated Apr 2026

📚 Playground and cheatsheet for learning Python. Collection of Python scripts that are split by topics and contain code examples with explanations.

A Python learning repo where every topic is a runnable test file with assertions showing expected output inline. Covers the core language from variables through generators, with standard library basics thrown in. Aimed squarely at beginners picking up Python 3 for the first time.

The test-as-documentation pattern is genuinely useful — you can read the assertions and immediately know what a function returns without running anything. Coverage of functions is thorough: default args, keyword args, *args/**kwargs, lambdas, decorators, and annotations all get their own file. Multilingual READMEs (Portuguese, Spanish, Traditional Chinese, Ukrainian) make it accessible to a much wider audience than English-only alternatives. Linting setup with both pylint and flake8 from day one teaches code style as part of the learning process, not as an afterthought.

Stops well short of modern Python — nothing on type hints in practice, dataclasses, async/await, or pathlib, which are all things a learner will hit immediately in real codebases. CI is still on Travis CI, which stopped being free years ago; the build badge is almost certainly broken and untested. The standard library tour is shallow — json, glob, re, math, datetime, zlib — and skips things like collections, itertools, and contextlib that come up constantly. No coverage of virtual environments beyond a brief mention, and nothing on packaging or imports beyond the basics.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →