Last active
June 14, 2017 17:13
-
-
Save seedifferently/7c42c12139b3dff56c1e603d78e48d81 to your computer and use it in GitHub Desktop.
Python dict check key
This file contains hidden or 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
>>> d = {'food': 'spam'} | |
>>> 'food' in d | |
True | |
>>> 'missing' in d | |
False | |
>>> 'missing' not in d | |
True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment