Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 16)
16.
What is the purpose of the @classmethod decorator?
To define a class method
To create a new instance of a class
To access class attributes directly
To override a method in the superclass
Answer: Option
Explanation:
The @classmethod decorator is used to define a class method, which is a method that is bound to the class and not the instance of the class.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.