SHSubjectHub

Inheritance and Subclasses (Python)

OOPA-levelLesson packSubscription

About this resource

Understand how one class can inherit the attributes and methods of another, how to extend a parent class, and how to use super() to call the parent constructor.

11 slides.

Lesson outline

  1. Is-A or Has-A?
  2. The Is-A Relationship
  3. Writing a Subclass
  4. Dog Inherits From Animal: Live Demo
  5. UML: Inheritance Arrow
  6. `isinstance()` — Is this object a Dog?
  7. Python vs C#: Inheritance Syntax
  8. Coding Practice: Animal Hierarchy
  9. Lesson Summary
Unit bundleUnit 3A · Inheritance and Subclasses
Part of: Unit 3A · Inheritance and Subclasses: the whole unitEvery resource in the unit in one zip.

More from Unit 3A · Inheritance and Subclasses