Created
September 10, 2018 16:58
-
-
Save benhoyt/e211858be3786a02b0f93153428effea to your computer and use it in GitHub Desktop.
Example of tuple unpacking in lambda parameters
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
$ python | |
Python 2.7.14 (default, Mar 1 2018, 19:26:37) | |
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> f = lambda x, (y, z): x+y+z | |
>>> f(1, (2, 3)) | |
6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment