Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo():
- def __init__(self, a):
- self.a = a
- def change_a(self, new_value):
- self.a = new_value
- foo1 = Foo(1)
- foo2 = Foo(2)
- foo1.a = 5
- foo2.change_a(5)
- print (foo1.a, foo2.a)
Advertisement
Add Comment
Please, Sign In to add comment