Final Answer:
Class methods, designated by the classmethod decorator, operate on class variables. They take the class itself as their first parameter and can modify class-level attributes. Unlike instance methods, which deal with instance-specific data, class methods are focused on actions involving the class as a whole, making them the correct choice for operations on class variables. Therefore b) Class methods is correct.
Step-by-step explanation:
Class methods operate on class variables only, making option (b) the correct answer. Class variables are shared among all instances of a class and are accessed using the class name. Class methods are defined using the classmethod decorator and take the class itself as the first parameter, conventionally named cls. These methods can modify class-level attributes but don't have access to instance-specific data.
In more detail, instance methods operate on instance variables, which are unique to each instance of a class, and they are defined without any decorators. On the other hand, static methods (option c) are not bound to class or instance variables; they are defined using the staticmethod decorator and don't take the class or instance as the first parameter.
Understanding the distinction between these types of methods is crucial for effective object-oriented programming. Class methods are particularly useful when you need to perform operations that involve the class itself rather than individual instances. They provide a way to interact with and modify class-level attributes, ensuring consistency across all instances of the class.