
Patrick B. answered 05/18/21
Math and computer tutor/teacher
class Counter:
def __init__(self,n):
self.initial_count=n
self.count = n
def GetCount(self):
return self.count
def GetInitialCount(self):
return self.initial_count
def plus_one(self):
self.count = self.count+1
def minus_one(self):
self.count = self.count-1
def reset_count(self):
self.count=self.initial_count
def start_num(self):
self.count = self.initial_count
def clear_count(self):
self.count=0
###############################################
myCounter = Counter(0)
for i in range(1,101):
myCounter.plus_one()
print(myCounter.GetCount())
print("*********************************************")
for i in range(1,101):
print(myCounter.GetCount())
myCounter.minus_one()