Created
September 3, 2010 06:56
-
-
Save kosugi/563530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def createFlipFlop(): | |
| def inner(): | |
| inner.p = not inner.p | |
| return inner.p | |
| inner.p = 0 | |
| return inner | |
| ff = createFlipFlop() | |
| print ff() | |
| print ff() | |
| print ff() | |
| print ff() | |
| print ff() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment