Skip to content

Instantly share code, notes, and snippets.

@eclecticmiraclecat
Last active June 1, 2020 06:42
Show Gist options
  • Save eclecticmiraclecat/6b287e5b3d7977fb76305f7b88abb059 to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/6b287e5b3d7977fb76305f7b88abb059 to your computer and use it in GitHub Desktop.
>>> def add(x, y):
... return x+y
...
>>> add(2,3)
5
>>>
>>> a = lambda : add(2,3)
>>> a
<function <lambda> at 0x7f95b61a0ae8>
>>> a()
5
>>> def do_add(x, y):
... def add():
... return x +y
... return add
...
>>>
>>> a = do_add(2,3)
>>> a()
5
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment