Learning path

OOP and design patterns in Python

Classes and objects, then the creational, structural and behavioral patterns used in real Python code.

14 lessons · 14 challenges

Start the path →

1 Classes and objects 2 lessons

  1. Lesson 1 challenge Class and Object in Python Define a Python class, create an object, and call an instance method.
  2. Lesson 1 challenge Object-Oriented Programming in Python Learn encapsulation, inheritance, method overriding, and polymorphism with a runnable Python OOP example.

2 Creational patterns 3 lessons

  1. Lesson 1 challenge Singleton Pattern in Python Ensure a class has one shared instance and provide a global access point.
  2. Lesson 1 challenge Factory Method Pattern in Python Let subclasses or a factory method choose which concrete object to create.
  3. Lesson 1 challenge Builder Pattern in Python Construct a complex object through clear, incremental steps.

3 Structural patterns 4 lessons

  1. Lesson 1 challenge Adapter Pattern in Python Convert an existing interface into the interface a client expects.
  2. Lesson 1 challenge Decorator Pattern in Python Add behavior to an object dynamically without changing its class.
  3. Lesson 1 challenge Facade Pattern in Python Provide one simple interface to a complex subsystem.
  4. Lesson 1 challenge Composite Pattern in Python Treat individual objects and object groups through the same interface.

4 Behavioral patterns 5 lessons

  1. Lesson 1 challenge Observer Pattern in Python Notify subscribed objects automatically when subject state changes.
  2. Lesson 1 challenge Strategy Pattern in Python Select an interchangeable algorithm at runtime.
  3. Lesson 1 challenge Command Pattern in Python Represent a request as an object that can be queued, logged, or undone.
  4. Lesson 1 challenge State Pattern in Python Change an object's behavior when its internal state changes.
  5. Lesson 1 challenge Iterator Pattern in Python Traverse a collection without exposing its internal representation.