Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 5)
5.
What happens when you use the @classmethod decorator on a method in a Python class?
Marks the method as a static method
Converts the method to a class method
Indicates the method is an instance method
Decorates the method with dynamic behavior
Answer: Option
Explanation:
The @classmethod decorator is used to convert a method into a class method, allowing it to access and modify class-level attributes, rather than instance-level attributes.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.