Skip to content

Instantly share code, notes, and snippets.

@marciomazza
Last active August 11, 2017 12:31
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 marciomazza/b1554d4c31916f11dd12203c949e41cb to your computer and use it in GitHub Desktop.
Save marciomazza/b1554d4c31916f11dd12203c949e41cb to your computer and use it in GitHub Desktop.
a == 1 or a == 2 or a == 3 # a == 1 or a == 2 or a == 3 or ... or a == N
a in [1, 2, 3] # a in [1, 2, 3, ..., N]
a if a else b
a or b
# ... list building with appends => list comprehensions
# ... similiar for set and dict comprehensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment