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

Connected

Exercise

Implementing Abstract Base Classes

Now that you've built the Company abstract base class, it can be used as a "blueprint" for different companies. You'll practice doing just this by creating a Technology class.

The Company class from the previous exercises has been defined for you, and looks like this:

class Company(ABC):
  @abstractmethod
  def create_budget(self):
    pass

  def hire_employee(self, name):
    print(f"Welcome to the team, {name}!")

Instructions

100 XP
  • Create a Technology class that inherits from the Company abstract base class.
  • Define the create_budget() method with two parameters, year and expenses.
  • Create an instance of the Technology class with name "Tina's Tech Advisors".
  • Call the create_budget() method using the provided arguments; observe the output of this method, as well as hire_employee().