Python Dictionary - not in function

key not in dict

Method Overview:

 

This method checks whether a given key is not present in the python dictionary. If the key is not present returns TRUE else returns FALSE.

 

Example:

           

>>> EnvironmentDictionary = {'path': '/bin:/opt/bin'}

 

>>> if 'path' not in EnvironmentDictionary:       

 

...          print('Path is not set')

    

     >>> else

    

     ...          print('Path is set')

    

     ...

    

     Path is Set

 


Copyright 2024 © pythontic.com