Created
March 18, 2017 17:13
-
-
Save singingwolfboy/fb24604cfa41cc8b89ea23456ba7d571 to your computer and use it in GitHub Desktop.
iterable unpacking works with generators, too!
This file contains hidden or 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
>>> def generator(): | |
... yield 4 | |
... yield 5 | |
... | |
>>> x, y = generator() | |
>>> x | |
4 | |
>>> y | |
5 | |
>>> # mind blown!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice, thanks