removing items from a dictionary ?

Paddy paddy3118 at googlemail.com
Sat Jul 28 04:16:36 EDT 2007


On Jul 28, 1:43 am, Steven D'Aprano
<st... at REMOVE.THIS.cybersource.com.au> wrote:
> On Thu, 26 Jul 2007 21:38:31 +0200, martyw wrote:
> > Remoing elements from a dict is done with del, try this;
> >  >>> d = {'a' : 1,'b' : 2}
> >  >>> del d['a']
> >  >>> print d
> > {'b': 2}
>
> > maybe you can post a working snippet to demonstrate your problem
>
> Wow. This wins my award for the least helpful, while still being
> technically correct, reply ever. Did you even read the Original Poster's
> post? He already knows that you delete items from a dictionary with del,
> and he posted code and the traceback he gets when he runs it.
>
> --
> Steven.

... But lets also applaud the fact that MartyW wants to help.

- Paddy.




More information about the Python-list mailing list