Created
December 19, 2019 08:57
-
-
Save vereperrot/d7d0ee4d3441fd1a0e394b8251962f33 to your computer and use it in GitHub Desktop.
list contains.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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