sck
while len(sck) > 0 :
del d[sck.pop()]
This works.
Is this the optimal pythonic way of doing it?
Mr. 427
Le vendredi 17 septembre 2010 à 21:36 -0400, bob gailer a écrit :
> On 9/17/2010 9:21 PM, M. 427 wrote:
> > Thank you,
> > After reading the fol
gt;
> On 9/17/2010 6:20 PM, M. 427 wrote:
> > Thank you very much for your answer.
> > I wanted to know the pythonic way of doing this, so I did not post my
> > buggy trial which was :
> >
> > version 1 :
> > for row in d :
> > if len(row) == 1 :
Hello,
(I am very new to python)
I built a dictionary d={} of lists similar to this :
d = {
'a': ['apricot', 'apple'],
'b': ['beach', 'bear', 'bottle'],
'c': ['cold', 'cook', 'coleslaw'],
'd': ['deep'],
'e': ['expression', 'elephant']
}
Now i want to go through this dictionary and remove all ro