Examveda

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

D. To define a method as static

Answer: Option C

Solution (By Examveda Team)

The @abstractmethod decorator indicates that a method must be overridden in subclasses.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth