Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass:
- def __init__(self, somedata):
- print somedata
- self.data = somedata
- def function(self):
- print self.data
- def hey(self, cool):
- self.data = cool
- class = MyClass("data1")
- class2 = MyClass("unicorn")
- class.function()
- class.hey("hello")
- class.function()
- class2.function()
- class.hey("yoo")
- class2.hey("yaya")
- class.function()
- class2.function()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement