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#

FundamentalsCore ConceptsAdvanced
Variables & ScopeFunctions & DecoratorsGenerators & Iterators
Data TypesClasses & OOPContext Managers
Strings & NumbersError HandlingType Hints
CollectionsFile I/OAsync/Await
Control FlowModules & Importsitertools & functools