Python Programming - Decorators - Discussion
Discussion Forum : Decorators - General Questions (Q.No. 1)
1.
How does the
@property
decorator differ from regular methods in a Python class?
Answer: Option
Explanation:
The
@property
decorator is used to define read-only properties in a class. It allows you to access a method as an attribute without the need for explicit getter methods. However, it doesn't provide a setter method, making the property read-only.
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