Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrealmar/d79a7ee77d0143b7c434 to your computer and use it in GitHub Desktop.
Save andrealmar/d79a7ee77d0143b7c434 to your computer and use it in GitHub Desktop.
>>> 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