Skip to content

Instantly share code, notes, and snippets.

@gnuvince
Created July 14, 2014 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnuvince/dc45daf97d3de3eef227 to your computer and use it in GitHub Desktop.
Save gnuvince/dc45daf97d3de3eef227 to your computer and use it in GitHub Desktop.
def g(x):
return x*x
def f(x):
global f
if x == 5:
f = g
return x
print [f(x) for x in xrange(10)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment