What does the @property decorator do in Python?
Correct answer
A. Lets a method be accessed like an attribute
6 views
A. Lets a method be accessed like an attribute
6 views
@property exposes a method as a read-only attribute (with optional setter).
Asked in: Python Interview OOP
https://docs.python.org/3/tutorial/classes.htmlNot sure why the answer is A? Ask here and get an explanation.