Vidyalelo
Python · Q9

Classes and Objects in Python

Programming · Python · question 9

Q9

What is the purpose of the @staticmethod decorator in Python classes?

A.
It defines a method that belongs to the class rather than an instance
Answer
B.
It defines a static attribute
C.
It defines a global function
D.
It defines a constructor

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board