Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Created June 21, 2019 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyaltrabelsi/1eb9b7375d1dc1020ac98ee1221b2b8c to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/1eb9b7375d1dc1020ac98ee1221b2b8c to your computer and use it in GitHub Desktop.
Python-tricks set comrehension
>>> m = {x ** 2 for x in range(5)}
>>> m
{0, 1, 4, 9, 16}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment