Select true statements about the static method. (select 2)

Questions & AnswersCategory: PythonSelect true statements about the static method. (select 2)
Lokesh Kumar Staff asked 2 years ago

Select true statements about the static method. (select two)
a. To get a static method, use the @staticmethod decorator.
b. A static method is a method that is bound to a specific instance of a class.
c. A static method is a method that acts like a normal function, only it is implemented in the class and is not bound to a specific instance of the class or the class itself.
d. To get a static method, use the @classmethoddecorator.
e. To get a static method, use the @propertydecorator.

1 Answers
Lokesh Kumar Staff answered 2 years ago

a. To get a static method, use the @staticmethod decorator.

c. A static method is a method that acts like a normal function, only it is implemented in the class and is not bound to a specific instance of the class or the class itself.

e. To get a static method, use the @propertydecorator.

Explanation:

@staticmethod – transform a method into a static method.