Create a dictionary and fetch value by key : Dictionary Fetch : Dictionary PYTHON examples


PYTHON examples » Dictionary » Dictionary Fetch »

 

Create a dictionary and fetch value by key


Create a dictionary and fetch value by key

d2 = {'spam': 2'ham': 1'eggs': 3}    # make a dictionary
print d2['spam']                               # fetch value by key


           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


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


PYTHON examples

 Navioo Dictionary
» Dictionary Fetch