Dictionary : Dictionary get : Dictionary PYTHON examples


PYTHON examples » Dictionary » Dictionary get »

 

Dictionary


Dictionary: Get value by key

d2 = {'spam': 2'ham': 1'eggs': 3}    # make a dictionary

print d2                                       # order is scrambled

print d2.get('spam'), d2.get('toast'), d2.get('toast', 88)


           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo Dictionary
» Dictionary get