Skip to content

Instantly share code, notes, and snippets.

@waynew
Created July 29, 2016 23:18
Show Gist options
  • Save waynew/35ae30cf0508be273ec389c3e09847c2 to your computer and use it in GitHub Desktop.
Save waynew/35ae30cf0508be273ec389c3e09847c2 to your computer and use it in GitHub Desktop.
class MyClass:
def __init__(self):
self.my_variable = 42
def show_my_variable(self):
print(self.my_variable)
thing = MyClass()
print(thing.my_variable)
thing.my_variable = 19
thing.show_my_variable()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment