Q. Which of the following will make `attr` a read-only property?
β
Correct Answer: (B)
@property
def attr(self): return self._attr
Explanation: Using `@property` allows defining read-only properties without a setter.