class TemperatureCelsius:
def __init__(self, temperature=0):
self._temperature = temperature
@property
def temperature(self) : float:
print("Getting temperature")
return self._temperature
@temperature.setter
def temperature(self, value: float):
if value < -273.15:
raise ValueError("Temperature must be greater equal than -273.15")
print("Setting value")
self._temperature = value
@temperature.deleter
def temperature(self):
print("Deleting value")
del self._temperature
temp = TemperatureCelsius()
temp.temperature = 37
print(temp.temperature)
del temp.temperature