Certified Professional in Python Programming (PCPP-32-101) — Question 32
What is a static method?
Answer options
- A. A method that works on the class itself
- B. A method decorated with the @method trait
- C. A method that requires no parameters referring to the class itself
- D. A method that works on class objects that are instantiated
Correct answer: C
Explanation
The correct answer, C, accurately describes a static method as it does not require any instance of the class to be referenced. Option A is incorrect because it implies a different aspect of static methods. Option B is misleading as the @method trait does not define static methods. Option D is wrong because static methods do not operate on instantiated objects.