[Tutor] python dictionary

sudhanshu gautam sudhanshu9252 at gmail.com
Tue Apr 14 19:42:19 CEST 2009


I was reading about the python dictionaries  had finished some methods
related to the dictionary.

we used get and setdefault methods to get the value from the dictionary if
it lies inside it

and setdefault used to set the value is side the dictionary if it does not
lies inside the dictionary.

so why we use setdefault I think in place of setdefault first we should
convert that dictionary in the list and now we can add new value then again
convert it in dictionary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090414/e22b9e16/attachment.htm>


More information about the Tutor mailing list