Rohit Kumar

Generation

generate functionTue, 22 Nov 2022

number tracking

class Counter(object): def __init__(self, start=0): self.count = start def click(self): self.count += 1 def reset(self): self.count = 0 return self.count c = Counter() c.click() c.click() c.click() c = Counter(100) c.reset()

Questions about programming?Chat with your personal AI assistant