Skip to content

Instantly share code, notes, and snippets.

@macleginn
Last active November 12, 2025 10:46
Show Gist options
  • Select an option

  • Save macleginn/c0c8aaf7c5f4f4bfb286a84f99a3d5fe to your computer and use it in GitHub Desktop.

Select an option

Save macleginn/c0c8aaf7c5f4f4bfb286a84f99a3d5fe to your computer and use it in GitHub Desktop.
class Counter:
def __init__(self):
self.count = 0
def get_value(self):
return self.count
def increment(self):
self.count += 1
c = Counter()
c.increment()
print('Current value:', c.get_value())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment