OOP

9. OOP#

Object-oriented programming is a paradigm for organizing data and behavior together in reusable types.

  • Classes as blueprints for objects

  • Instances as concrete objects with their own state

  • Methods as behavior attached to objects

  • Encapsulation, inheritance, polymorphism, and abstraction

  • Advanced class features for Pythonic designs

This chapter starts with foundational ideas, works through practical examples, and builds toward more advanced OOP techniques.

Video

This overview introduces classes, instances, attributes, and methods in Python.

Learning Goals

By the end of this chapter, you will be able to:

  1. Explain what object-oriented programming is and why it is useful

  2. Distinguish between a class and an instance

  3. Create a simple class with attributes and methods

  4. Recognize everyday Python values as instances of classes

  5. Use methods such as __init__, __str__, and operator overloads

Chapter Flow

Chapter Overview Slides