The has_key method checks whether a dictionary has a given key. : Has_key : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Has_key »

 

The has_key method checks whether a dictionary has a given key.


d = {'name':'Joe'}
print d.has_key('name')
d['name'] 'Eric'
print d.has_key('name')



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Has_key