Python: Zero to Hero

A complete quiz-based curriculum covering Python from first principles to expert-level, production-grade knowledge. Python's simplicity hides a lot of nuance — this track is built around the surprises that trip up even experienced developers.

How to Use This Quiz Track

  • Work through the parts in order; later quizzes assume comfort with core data structures and OOP from earlier parts.
  • Each quiz has 20 multiple-choice questions, ordered from basic recall to edge cases to best-practice judgment calls.
  • Click Show Answer only after committing to a choice — the explanations cover the underlying mechanism (mutability, the GIL, MRO, descriptor protocol), not just the right letter.
  • Expect classic "wat" moments — mutable default arguments, late-binding closures, and is vs == — turned into quiz questions.

Prerequisites

None for Part 1. Comfort with basic programming concepts (variables, loops) helps but isn't required.

Curriculum

Part 1 — Foundations

#TopicWhy It Matters
01Introduction & SetupCPython vs. other implementations and version differences (2 vs 3) shape everything downstream.
02Variables & Data TypesDynamic typing, object identity, and small-int caching produce classic is-vs-== gotchas.
03Operators & ExpressionsChained comparisons, // vs /, and operator overloading via dunder methods are frequent traps.
04Control Flowfor...else, walrus operator, and truthy/falsy rules for custom objects surprise newcomers.
05FunctionsMutable default arguments are Python's most famous footgun.
06Strings & TextImmutability, encoding pitfalls, and f-string evaluation order matter in real code.

Part 2 — Core Data Structures

#TopicWhy It Matters
07Lists & TuplesShallow copies, list aliasing, and tuple immutability-of-reference-not-contents are daily bugs.
08Dictionaries & SetsHashability rules and insertion-order guarantees (3.7+) affect correctness and performance.
09Comprehensions & GeneratorsLazy evaluation and comprehension scoping are common sources of subtle bugs.
10Functional Programmingmap/filter/reduce, lambda limitations, and functools are idiomatic in data-heavy code.
11Closures & DecoratorsLate-binding closures in loops and decorator argument order are classic interview gotchas.

Part 3 — OOP & Design

#TopicWhy It Matters
12Classes & ObjectsClass vs. instance attributes and mutable class-level defaults cause shared-state bugs.
13Inheritance & PolymorphismMethod Resolution Order (MRO) and super() in multiple inheritance are frequently misunderstood.
14Magic Methods & Protocols__eq__/__hash__ consistency and operator dunders define how objects behave idiomatically.
15Properties & DescriptorsThe descriptor protocol underlies @property, ORMs, and much of Python's "magic."

Part 4 — Robustness & I/O

#TopicWhy It Matters
16Error HandlingBare except, exception chaining, and finally-with-return interactions cause silent bugs.
17Modules & PackagesCircular imports and __init__.py semantics are frequent real-world stumbling blocks.
18File I/O & SerializationContext managers, encoding defaults, and pickle security risks matter in production.
19Iterators & Context ManagersThe iterator protocol and __enter__/__exit__ exception suppression are easy to misuse.
20Type Hints & TypingOptional, generics, and runtime-vs-static-only enforcement are widely misunderstood.

Part 5 — Concurrency & Meta

#TopicWhy It Matters
21Concurrency: Threading & MultiprocessingThe GIL means threads don't parallelize CPU-bound work — a top source of design mistakes.
22Async/AwaitBlocking calls inside async def silently kill concurrency without raising an error.
23MetaprogrammingMetaclasses, __init_subclass__, and dynamic attribute access power frameworks like Django.

Part 6 — Professional & Expert

#TopicWhy It Matters
24TestingFixture scope, mocking pitfalls, and parametrization determine test suite trustworthiness.
25Packaging & Virtual EnvironmentsDependency resolution and pyproject.toml conventions are essential for shipping real projects.
26Performance & OptimizationProfiling before optimizing, and knowing where CPython is slow, prevents wasted effort.
27Securityeval/pickle risks and injection vectors are the most common Python vulnerabilities.
28Exercises & Projects (Capstone)A mixed-review capstone spanning generators, decorators, OOP, and concurrency.