1.3 - Abstract Base Classes (ABCs) and Interfaces
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
Define an Abstract Base Class in Python.
💡 Hint: Refer to the `abc` documentation.
What happens if you instantiate an abstract class directly?
💡 Hint: Think of trying to create a shape without knowing which specific shape it is.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What is an Abstract Base Class?
💡 Hint: Think of a class outlining instructions.
True or False: Abstract methods must be implemented in subclasses.
💡 Hint: Remember the nature of abstract methods.
1 more question available
Challenge Problems
Push your limits with advanced challenges
Design an abstract class for a Vehicle that mandates methods start and stop. Implement this ABC for the sub-classes Car and Bicycle.
💡 Hint: Consider how vehicles might behave differently when starting and stopping.
Create an abstract base class named Employee that includes an abstract method calculate_salary. Design subclasses for FullTimeEmployee and PartTimeEmployee.
💡 Hint: Think about how salaries differ for full-time versus part-time positions.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.