Created
November 27, 2018 07:49
-
-
Save bsless/c6e1107f4ff4b1c4916e1b61167494f2 to your computer and use it in GitHub Desktop.
Applying lambdas to dictionaries in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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