Analysis updated 2026-06-24
Learn Python from scratch by editing and running small example scripts.
Use the repo as a quick cheat sheet to look up forgotten syntax.
Practice writing Python by adding your own assertions to existing examples.
Run the linter to check your code follows Python style conventions.
| trekhleb/learn-python | sczhou/codeformer | fastapi/sqlmodel | |
|---|---|---|---|
| Stars | 17,955 | 17,960 | 17,928 |
| Language | Python | Python | Python |
| Setup difficulty | easy | hard | easy |
| Complexity | 1/5 | 4/5 | 2/5 |
| Audience | developer | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Just needs Python 3 installed, clone and run any script.
learn-python is a collection of Python scripts designed to teach you the Python programming language through hands-on examples and a built-in cheat sheet. Python is a popular, beginner-friendly programming language used for everything from web apps to data analysis. The repository is organized by topic, covering things like variables, data types, control flow (if/for/while statements), functions, classes, error handling, file reading, and parts of Python's standard library. Each script follows the same pattern: a brief explanation at the top, then code examples paired with assertions (checks that confirm what the output should be), so you can see exactly what each piece of code does without having to run it yourself. The "playground" aspect means you can open any script, tweak the code, add your own examples, and run the built-in tests to see if your changes work. This makes learning interactive rather than passive, you experiment directly in the code instead of just reading about it. The "cheatsheet" aspect means you can return later to quickly look up Python syntax you've forgotten, like how lists work or how to handle exceptions. The repository is written in Python 3 and covers beginner-to-intermediate ground. You would use it if you are new to Python and want structured, runnable examples to practice with, or if you already know some Python and need a quick reference for syntax. It also supports linting so you can check whether your code follows Python style conventions.
A topic-by-topic collection of runnable Python scripts that teach the language by example and double as a cheat sheet you can come back to.
Mainly Python. The stack also includes Python, pytest.
License is not stated in the explanation.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.