To access individual dictionary elements, you use the familiar square brackets along with the key to obtain its value : Index : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Index »

 

To access individual dictionary elements, you use the familiar square brackets along with the key to obtain its value


dict2 = {'name': 'earth', 'port': 80}

dict2['name']
print 'host %s is running on port %d' % (dict2['name'], dict2['port'])



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Dictionary
» Index