Skip to content

Instantly share code, notes, and snippets.

@kosugi
Created September 3, 2010 06:56
Show Gist options
  • Select an option

  • Save kosugi/563530 to your computer and use it in GitHub Desktop.

Select an option

Save kosugi/563530 to your computer and use it in GitHub Desktop.
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