trekhleb/learn-python

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

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 48 minutes ago
Added to GitGenius on September 3rd, 2026
Created on August 29th, 2018
Open Issues & Pull Requests: 43 (+0)
GitHub issues: Enabled
Number of forks: 2,975
Total Stargazers: 18,270 (+0)
Total Subscribers: 723 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.0 hours
Mean response time: 259.1 days
90th percentile: 1130.4 days
Tracked items: 7

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 9
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 556 days
Stale 30+ days: 9
Stale 90+ days: 8

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

learn-python is a collection of Python scripts organized by topic that serves as both an interactive playground and a cheatsheet for learning Python.

The repository addresses the need for hands-on Python learning by providing code examples with explanations, use cases, and links to further reading organized by topic. Each script follows a consistent structure with docstrings, code examples, and assertions that demonstrate expected output. The interactive approach lets learners modify code and run tests to see results immediately, while built-in linting checks help maintain code quality from the start. Assertions embedded throughout the examples allow readers to verify expected behavior without executing scripts separately.

The tool suits beginners and intermediate learners who want to learn Python through doing rather than passive reading. It works well for those seeking a reference guide to recap syntax and standard constructions, or for anyone building a foundation in Python fundamentals. The repository is language-agnostic in its educational value but Python-specific in its examples, making it most useful for developers focused on Python rather than polyglots seeking cross-language comparisons.

The project maintains a stable collection of topic-based scripts with consistent structure and documentation. Updates appear focused on expanding topic coverage and refining existing examples rather than pursuing new architectural directions. The codebase remains straightforward and accessible, reflecting an emphasis on clarity for learners over complexity.