how can I clear a dictionary in python

Larry Bates lbates at websafe.com
Wed Mar 28 18:48:46 EDT 2007


Marko.Cain.23 at gmail.com wrote:
> Hi,
> 
> I create a dictionary like this
> myDict = {}
> 
> and I add entry like this:
> myDict['a'] = 1
> but how can I empty the whole dictionary?
> 
> Thank you.
> 

just point myDict to an empty dictionary again

myDict={}

Larry Bates




More information about the Python-list mailing list