Created
October 9, 2014 18:53
-
-
Save mattias-lidman/228a4ce81fd9f2917d46 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 0x7f7de8dc6cd0> | |
>>> 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