Select true statements about the class method. (select Three)
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.
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.