Skip to content

Instantly share code, notes, and snippets.

@saghul
Created November 20, 2010 15:35
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 saghul/707901 to your computer and use it in GitHub Desktop.
Save saghul/707901 to your computer and use it in GitHub Desktop.
lambda example 3
In [1]: def sum(x,y):
...: return x+y
...:
In [2]: increment = 1
In [3]: f = lambda n: sum(n,increment)
In [4]: f(1)
Out[4]: 2
In [5]: f(3)
Out[5]: 4
In [6]: increment = 5
In [7]: f(1)
Out[7]: 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment