1. Learn
  2. /
  3. Courses
  4. /
  5. Object-Oriented Programming in Python

Connected

Exercise

Create a subclass

The purpose of child classes -- or sub-classes, as they are usually called - is to customize and extend functionality of the parent class.

Recall the Employee class from earlier in the course. In most organizations, managers enjoy more privileges and more responsibilities than a regular employee. So it would make sense to introduce a Manager class that has more functionality than Employee.

But a Manager is still an employee, so the Manager class should be inherited from the Employee class.

Instructions 1/2

undefined XP
    1
    2
  • Add an empty Manager class that is inherited from Employee.
  • Create an object mng of the Manager class with the name Debbie Lashko and salary 86500.
  • Print the name of mng.