Python Cheatsheet
A practical reference for Python fundamentals through intermediate topics. Each section includes runnable examples, common variants, typical mistakes to avoid, and AI prompts to explore further.
How to Use This Cheatsheet#
- Quick lookup: Use the sidebar to jump to any topic of interest
- Learn concepts: Each card has multiple tabs — explore Examples, Variants, and Mistakes
- Practice: Copy examples into the playground on the right to experiment
- Go deeper: Use the AI prompts in each card to ask follow-up questions
Suggested Path#
If you're new to Python, work through topics in order: Variables → Data Types → Collections → Control Flow → Functions. For intermediate developers, jump directly to Classes, Error Handling, or Advanced Topics.
What's Covered#
| Fundamentals | Core Concepts | Advanced |
|---|---|---|
| Variables & Scope | Functions & Decorators | Generators & Iterators |
| Data Types | Classes & OOP | Context Managers |
| Strings & Numbers | Error Handling | Type Hints |
| Collections | File I/O | Async/Await |
| Control Flow | Modules & Imports | itertools & functools |