Q. Which of the following defines a property in Python?
β
Correct Answer: (B)
@property
def name(self): return self._name
Explanation: The @property decorator is used to define getter methods as attributes.