Question

Given the following Python-like code snippet:     ```python     class Counter:         def __init__(self):             self.count = 0         def increment(self):             self.count += 1         def get_count(self):             return self.count     c1 = Counter()     c2 = Counter()     c1.increment()     c1.increment()     c2.increment()     print(c1.get_count() + c2.get_count())     ```     What will be the output?

A 1
B 2
C 3
D 4
Practice Next

Hey! Ask a query