MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / Counter

Class Counter

example_code/item_124.py:63–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62print("Example 3")
63class Counter:
64 def __init__(self):
65 self.value = 0
66
67 def add(self, offset):
68 value += offset
69
70 def get(self) -> int:
71 self.value
72
73
74print("Example 4")

Callers 1

item_124.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected