Object Oriented Programming in Python

Abstract

This notebook introduces object oriented programming in Python with a focus on practical patterns for teaching and learning.
You will learn how to define classes, work with attributes and methods, and apply core concepts like inheritance, composition, and encapsulation.
Examples use plain Python and only the standard library.

Learning goals
After completing this notebook, you will be able to

  • Explain what a class and an object are
  • Define classes with attributes and methods
  • Use the __init__ constructor to initialize state