Python Programming - Encapsulation - Discussion

Discussion Forum : Encapsulation - General Questions (Q.No. 3)
3.
What is the purpose of the @property decorator?
To define a class property
To create a class instance
To access a class attribute
To define a getter method for a class attribute
Answer: Option
Explanation:
The @property decorator is used in Python to define a getter method for a class attribute, allowing controlled access.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.