Question OOP-ENC-0063
HardWhat is the output of this code?
class Temp:
def __init__(self, c):
self.c = c
@property
def f(self):
return self.c * 9 / 5 + 32
@f.setter
def f(self, v):
self.c = (v - 32) * 5 / 9
t = Temp(100)
t.f = 50
print(round(t.c, 2), t.f)
- A.
50 122.0
- B.
10.0 50.0
- C.
Sign up free to see the answer and a step-by-step explanation.