Skip to content

Instantly share code, notes, and snippets.

@joshmarlow
Created November 2, 2012 15:10
Show Gist options
  • Save joshmarlow/4001910 to your computer and use it in GitHub Desktop.
Save joshmarlow/4001910 to your computer and use it in GitHub Desktop.
Random file for playing with ast
def f3(x):
return 3*x
def f4(x):
return 4*x
def f2a(x):
return 2*f3(x)
def f2b(x):
return 2*x + 1 + f4(x)
def f(x):
return f2a(x) + f2b(x)
x = 1
for i in range(10):
new_x = f(x)
print "{0} -> {1}".format(x, new_x)
x = new_x
print "{0} -> {1}".format(x, new_x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment