Python Programming - Classes - Discussion
Discussion Forum : Classes - General Questions (Q.No. 6)
6.
What is the purpose of the
@classmethod
decorator?
Answer: Option
Explanation:
The
@classmethod
decorator in Python is used to define a class method. A class method takes the class as its first parameter, conventionally named cls
, allowing it to access and modify class-level attributes.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers