Delete dictionary entry : Dictionary Del : Dictionary PYTHON examples


PYTHON examples » Dictionary » Dictionary Del »

 

Delete dictionary entry


Delete dictionary entry

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

print d2                                       # order is scrambled

d2['ham'] ['grill', 'bake', 'fry']      # change entry

del d2['eggs']                            delete entry

print d2

           
       



    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 Del