[Tutor] python dictionary

bob gailer bgailer at gmail.com
Tue Apr 14 19:52:14 CEST 2009


sudhanshu gautam wrote:
> I was reading about the python dictionaries  
That is a good thing to do.
> had finished some methods related to the dictionary.
No comprehend.
>
> 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.
Those are good things to do.

>
> 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
>
I'm sorry but I do not understand the final paragraph.
It might help a little if you were to use more punctuation.
Are you asking a question?
Could you give an example?

-- 
Bob Gailer
Chapel Hill NC
919-636-4239


More information about the Tutor mailing list