Skip to content

Instantly share code, notes, and snippets.

@vereperrot
Created December 19, 2019 08:57
Show Gist options
  • Save vereperrot/d7d0ee4d3441fd1a0e394b8251962f33 to your computer and use it in GitHub Desktop.
Save vereperrot/d7d0ee4d3441fd1a0e394b8251962f33 to your computer and use it in GitHub Desktop.
list contains.py
#https://stackoverflow.com/questions/12934190/is-there-a-short-contains-function-for-lists
if myItem in list:
# do something
#Also, inverse operator:
if myItem not in list:
# do something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment