Skip to content
C

Temperature Property Class

Easypython

Create a Temperature class with a celsius attribute and a fahrenheit property that automatically calculates Fahrenheit from the stored Celsius value.

What the problem means: fahrenheit shouldn't be stored separately — it should always be computed live from celsius, and accessed like a plain attribute (no parentheses).

Approach: store celsius directly in init; define fahrenheit as a method decorated with @property that returns celsius * 9/5 + 32.

Input: One line: a Celsius temperature.

Output: One line: the Fahrenheit equivalent.

Input (stdin)

Output

Run your code to see output here...