Question OOP-POLY-0039
EasyWhat is the output of this code?
class Bag:
def __init__(self):
self.items = [1, 2, 3]
def __len__(self):
return len(self.items)
print(len(Bag()))
- A.
Error
- B.
6
- C.
3
- D.
1
Sign up free to see the answer and a step-by-step explanation.