Examveda

How is a decorator applied to a class method in Python?

A. By using the @decorator syntax above the class

B. By using the @decorator syntax above the method

C. By applying the decorator within the method

D. By using the apply_decorator() function

Answer: Option B

Solution (By Examveda Team)

A decorator is applied to a class method using the @decorator syntax above the method definition.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth