Thermostat exposing celsius as a property whose setter rejects values below absolute zero (-273.15) with ValueError, and a derived read-only property fahrenheit. Property setters let you keep attribute syntax (t.celsius = 25) while still validating.t = Thermostat(20); t.celsius = 25; t.fahrenheit
77.0
The setter accepted 25; fahrenheit derives from it.
t.celsius = -300
ValueError
Below absolute zero.
Store the real value in self._celsius.
F = C × 9/5 + 32.