updating dictionary you can update dictionary by adding new entry or key-value pairmodifying an existing entryor deleting an existing entry as shown below in the simple example#!/usr/bin/python dict {'name''zara''age' 'class''first'dict['age' update existing entry dict['school'"dps school"add new entry print "dict['age']"dict['age'print "dict['school']"dict['school'when the above code is executedit produces the following resultdict['age'] dict['school']dps school delete dictionary elements you can either remove individual dictionary elements or clear the entire contents of dictionary you can also delete entire dictionary in single operation to explicitly remove an entire dictionaryjust use the del statement simple example is as mentioned below#!/usr/bin/python dict {'name''zara''age' 'class''first'del dict['name']remove entry with key 'namedict clear()remove all entries in dict del dict delete entire dictionary print "dict['age']"dict['age'print "dict['school']"dict['school'note that an exception is raisedbecause after del dict dictionary does not exist anymore this produces the following resultdict['age']traceback (most recent call last)