Question OOP-CLS-0019
HardWhat is the output of this code?
class Rect:
def __init__(self, w, h):
self.w, self.h = w, h
@property
def area(self):
return self.w * self.h
r = Rect(2, 4)
print(r.area)
- A.
8
- B.
Error
- C.
5
- D.
13
Sign up free to see the answer and a step-by-step explanation.