Advertisement
Guest User

Untitled

a guest
Jul 6th, 2013
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1.  
  2. class Test:
  3.  
  4.     option1 = []
  5.  
  6.     def __init__(self):
  7.         self.option2 = []
  8.  
  9.     def test(self):
  10.         self.option1.append('test')
  11.         self.option2.append('test')
  12.  
  13.  
  14.  
  15. c = Test()
  16. c.test()
  17. print(c.option1, c.option2, '\n\n==\n') # ['test'] ['test']
  18.  
  19. c = Test()
  20. c.test()
  21. print(c.option1, c.option2, '\n\n==\n') # ['test', 'test'] ['test']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement