Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo:
- def __init__(s):
- s.tapped = False
- def tap(s):
- s.tapped = True
- def untap(s):
- s.tapped = False
- bar = Foo();
- print bar.tapped #prints False (set in constructor)
- bar.tap()
- print bar.tapped #prints True
- bar.untap()
- print bar.tapped #prints False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement