Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created August 16, 2016 11:11
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 tadzik/d6332f22dbf121b529511867767852c4 to your computer and use it in GitHub Desktop.
Save tadzik/d6332f22dbf121b529511867767852c4 to your computer and use it in GitHub Desktop.
┌─[tadzik@yavin]─[~]
└─[%]─> cat dupa.py
args = [1, 2, 3, 4]
lambdas = []
for a in args:
lambdas.append(lambda x: x + a)
for l in lambdas:
print(l(0))
┌─[tadzik@yavin]─[~]
└─[%]─> python dupa.py
4
4
4
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment