Examveda

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

A. To define a class method

B. To define an instance method

C. To define a static method

D. To define a constructor method

Answer: Option A

Solution (By Examveda Team)

The @classmethod decorator is used to define a method that operates on the class and not just instances.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth