← Quiz: Encapsulation and Abstraction: all 10 questions
Quiz: Encapsulation and Abstraction · Question 4 of 10
In Python, what happens when you try to create an object of a class with an @abstractmethod that isn't implemented?
In Python, what happens when you try to create an object of a class with an @abstractmethod that isn't implemented?
- A.It works normally
- B.TypeError
- C.It returns None
- D.SyntaxError
Answer & explanation
Correct answer: TypeError
Abstract classes can't be instantiated until all abstract methods are implemented.
Can you get the rest right without peeking?
Take the timed Quiz: Encapsulation and Abstraction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →