Select true statements about the class method. (select Three)

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

Select true statements about the class method. (select three)

a. A class method is bound to a specific class, not a specific instance.

b. We can get a class method by using the @staticmethod decorator.

c. We can get a class method by using the @property decorator.

d. A class method receives the class implicitly as its first argument (cls convention) just as an instance method receives an instance (self convention).

e. We can get a class method by using the @classmethod decorator.

1 Answers
Lokesh Kumar Staff answered 2 years ago

a. A class method is bound to a specific class, not a specific instance.

d. A class method receives the class implicitly as its first argument (cls convention) just as an instance method receives an instance (self convention).

e. We can get a class method by using the @classmethod decorator.

Explanation:

@classmethod – transform a method into a class method.