Code24Lab
Python Intermediate

Python in Practice: OOP, Modules, Comprehensions & Testing

Trace real Python code for classes, inheritance, dunder methods, modules, comprehensions, exceptions, regex and pytest, and predict what it returns, with every answer checked as you go.

21 lessons 21 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

In this intermediate Python course you read real code for a fictional tea shop and predict exactly what it does. You trace classes and properties, follow super() through inheritance and the MRO, make objects sortable and list-like with dunder methods, and keep money exact in cents. You see how imports, packages and the module cache really behave, evaluate list, dict and set comprehensions, follow try, except, else and finally, parse text with regular expressions and think like pytest: parametrized boundary cases, fixtures and coverage. Every lesson is a hands-on lab with instant checks, and a capstone checkout and final exam lead to your certificate. First lesson free.

Lessons

  1. Classes & Objects: Model Products with __init__ and MethodsLabFree
  2. Class vs Instance Attributes: Shared Defaults and ShadowingLab Locked
  3. Properties: Validated Attributes with @property and SettersLab Locked
  4. Inheritance & super(): Extend Products without Copying CodeLab Locked
  5. Polymorphism & MRO: One Call, Many Shipping ClassesLab Locked
  6. Dunder Methods I: __repr__, __eq__, __lt__ and Sorting ObjectsLab Locked
  7. Dunder Methods II: Make a Cart Behave Like a ListLab Locked
  8. Operator Overloading: A Money Class with +, * and Exact CentsLab Locked
  9. Dataclasses: Less Boilerplate, Ordering and __post_init__Lab Locked
  10. Modules: Import Once, Names, Bindings and reload()Lab Locked
  11. Packages: __init__.py, Relative Imports and Import CostLab Locked
  12. List Comprehensions: Map, Filter and Conditional ExpressionsLab Locked
  13. Dict & Set Comprehensions: Group, Deduplicate, Last-WinsLab Locked
  14. Built-ins with key=, Generators and next(): Idiomatic SearchingLab Locked
  15. Exceptions: try, except, else, finally and Control FlowLab Locked
  16. Custom Exceptions: Hierarchies, raise and Handler OrderLab Locked
  17. Regular Expressions I: Anchors, Classes and QuantifiersLab Locked
  18. Regular Expressions II: Groups, findall and TuplesLab Locked
  19. Testing with pytest: assert, parametrize and Boundary CasesLab Locked
  20. pytest Fixtures, Scopes and CoverageLab Locked
  21. Capstone: A Tested Checkout with Classes, Exceptions and Exact CentsLab Locked