Skip to content

Instantly share code, notes, and snippets.

@poros
Created October 4, 2015 14:09
Show Gist options
  • Save poros/2082c143b11bab98dc83 to your computer and use it in GitHub Desktop.
Save poros/2082c143b11bab98dc83 to your computer and use it in GitHub Desktop.
List/dict/set comprehensions
[x**2 for x in (2,4,6)]
{x: x**2 for x in (2, 4, 6)}
{x for x in 'abracadabra' if x not in 'abc'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment