Created
March 8, 2016 03:36
-
-
Save andrealmar/d79a7ee77d0143b7c434 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 = [1, 2, 3, 4, 5, 6, 6, 8] | |
>>> x | |
[1, 2, 3, 4, 5, 6, 6, 8] | |
>>> generator_expression = (i for i in x) | |
>>> generator_expression | |
<generator object <genexpr> at 0x101812af0> | |
>>> list_comprehension = [i for i in x] | |
>>> list_comprehension | |
[1, 2, 3, 4, 5, 6, 6, 8] | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment