Created
October 9, 2014 18:52
-
-
Save mattias-lidman/e6f5e3a79f76a22a32dc to your computer and use it in GitHub Desktop.
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
>>> ( x for x in [1,2,3] ) | |
<generator object <genexpr> at 0x7fcf3ed0ccd0> | |
>>> x | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 'x' is not defined | |
>>> # OK, seems legit | |
... { x:x for x in [1,2,3] } | |
{1: 1, 2: 2, 3: 3} | |
>>> x | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 'x' is not defined | |
>>> # So far so good... | |
... [ x for x in [1,2,3] ] | |
[1, 2, 3] | |
>>> x | |
3 | |
>>> # MIND = BLOWN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment