Question OOP-ENC-0062
HardWhat is the output of this code?
class Account:
def __init__(self):
self._bal = 0
@property
def bal(self):
return self._bal
a = Account()
try:
a.bal = 100
except AttributeError:
print("read-only", a.bal)
- A.
read-only 100
- B.
0
- C.
Sign up free to see the answer and a step-by-step explanation.