Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythonpropertySingle-choice MCQ

What is printed by this property-based code, and why?

class Temp: def __init__(self, c): self.celsius = c @property def fahrenheit(self): return self.celsius * 9 / 5 + 32 @fahrenheit.setter def fahrenheit(self, f): self.celsius = (f - 32) * 5 / 9 t = Temp(0) t.fahrenheit = 212 print(t.celsius)