Compare with cmp() : Compare dictionary : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Compare dictionary »

 

Compare with cmp()


dict1 = {}
dict2 = {'host': 'earth', 'port': 80}
print cmp(dict1, dict2)
dict1['host'] 'earth'
print cmp(dict1, dict2)
dict1['port'] 8080
print cmp(dict1, dict2)
dict1['port'] 80
print cmp(dict1, dict2)



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Dictionary
» Compare dictionary