Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 19)
19.
What is the purpose of the @staticmethod decorator?
To define a static 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 @staticmethod decorator is used to define a static method in a class, which is a method that belongs to the class rather than an instance.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.