Vidyalelo
Python · Q18

Decorators in Depth

Programming · Python · question 18

Q18

What is the purpose of the @abstractmethod decorator in Python?

A.
To create abstract classes
B.
To prevent method overriding
C.
To indicate that a method must be overridden in subclasses
Answer
D.
To define a method as static

Answer: Option C

Solution

Answer: Option C
Solution:
The @abstractmethod decorator indicates that a method must be overridden in subclasses.