Skip to content

Instantly share code, notes, and snippets.

@bsless
Created November 27, 2018 07:49
Show Gist options
  • Save bsless/c6e1107f4ff4b1c4916e1b61167494f2 to your computer and use it in GitHub Desktop.
Save bsless/c6e1107f4ff4b1c4916e1b61167494f2 to your computer and use it in GitHub Desktop.
Applying lambdas to dictionaries in python
d = dict(a=1, b=2, c=3)
# it really should not be that weird
list(map(lambda k, v: (k, 2*v), *zip(*d.items())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment