Question OOP-ENC-0043
MediumWhat is the output of this code?
class R:
def __init__(self):
self._items = [1, 2]
def items(self):
return list(self._items)
r = R()
r.items().append(3)
print(len(r.items()))
- A.
2
- B.
1
- C.
Sign up free to see the answer and a step-by-step explanation.