QUESTION 8 OF 10

Why use @property instead of exposing an attribute directly?

Reveal the answer and explore the explanation.

08
Medium

Why use @property instead of exposing an attribute directly?

Answer
Answer

A property exposes managed attribute access through methods while preserving normal access syntax.

Practical example

Validate an inference threshold before allowing it to change.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As