Python - Methods and Behavior Definition
What will be the output of this code?
class Tally:
def __init__(self):
self.total = 0
def add(self):
self.total += 2
def get_total(self):
return self.total
t = Tally()
t.add()
t.add()
print(t.get_total())