Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1.  
  2. class Foo:
  3.     def __init__(s):
  4.         s.tapped = False
  5.  
  6.     def tap(s):
  7.         s.tapped = True
  8.  
  9.     def untap(s):
  10.         s.tapped = False
  11.  
  12. bar = Foo();
  13. print bar.tapped #prints False (set in constructor)
  14. bar.tap()
  15. print bar.tapped #prints True
  16. bar.untap()
  17. print bar.tapped #prints False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement