Skip to content

Instantly share code, notes, and snippets.

@JackInTaiwan
Created November 21, 2018 09:20
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 JackInTaiwan/f7c094de3b6c37b43c3ccf02e8756e89 to your computer and use it in GitHub Desktop.
Save JackInTaiwan/f7c094de3b6c37b43c3ccf02e8756e89 to your computer and use it in GitHub Desktop.
### Use recursive lambda functions to define function with multiple arguments
add = lambda x: (lambda y: x + y)
print(add(3)(5))
# > 8
### Use normal function to do the same thing
def add(x, y):
return x + y
print(add(3, 5))
# > 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment