How does a @staticmethod differ from a @classmethod in Python?
Correct answer B. A static method receives no implicit first argument, while a class method receives the class as cls
Explanation
A static method behaves like a plain function placed in the class namespace and gets no automatic first argument. A class method receives the class it was called on as its first argument, which makes it useful for alternative constructors that work correctly in subclasses. Both can be called on the class or an instance.
Answer checked How we write and check questions
Discussion