Creating, accessing and modifying a dictionary. : Delete : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Delete »

 

Creating, accessing and modifying a dictionary.


emptyDictionary = {}
print emptyDictionary

grades = "A"87"B"76"C"92"D"89 }
print "nAll grades:", grades

print grades"A" ]
grades"A" 90
print "A's new grade:", grades"A" ]

# add to an existing dictionary
grades"B" 93
print "nDictionary grades after modification:"
print grades

delete entry from dictionary
del grades"C" ]
print "nDictionary grades after deletion:"
print grades



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Dictionary
» Delete