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?Solution
Dry Run: `c1 = Counter()` -> `c1.count = 0` `c2 = Counter()` -> `c2.count = 0` `c1.increment()` -> `c1.count = 1` `c1.increment()` -> `c1.count = 2` `c2.increment()` -> `c2.count = 1` `print(c1.get_count() + c2.get_count())` -> `print(2 + 1)` -> `3`
The term ‘red herring’ is associated with –
Consider the following statement about earthquake –
I) Intensity of earthquakes is measured on the Mercalli Scale.
II) Magnitude of ...
Which of the following bank and Bharti Airtel Limited has started the joint venture name “Airtel Payment Bank
Which of the following is not recommended by the committee on banking sector reforms?
Banks are not required to maintain CRR for the funds raised through CDs (certificate of deposits)
Who are the primary participants in the Indian money market?
The theme of National Youth Festival observed on 12th January was:
In regards to Mountains in Uttarakhand, which of the following is not correctly matched?
Actor Robbie Coltrane passed away at the age of 72, he played a role in which Hollywood movie?
Which is the currency of China?