key not in dict
Method Overview:
- The operator not in checks whether a given key is not present in a Python dictionary. If the key is not present returns TRUE else returns FALSE.
- The not in operator behaves the opposite of the in operator.
Example:
# Example Python progran that checks whether environmentDictionary = {'path': '/bin:/opt/bin'} if 'path' not in environmentDictionary: |
Output:
Path is set |