On Fri, Sep 17, 2010 at 9:08 AM, M. 427 <4...@free.fr> wrote: > 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 rows containing > only one entry. How should I do that? > > You can loop through all the entries in d, and remove the entries that have length one. Hope that isn't too much of a hint
> > Question 2 : where should I have found this answer myself? (apart from > here) > > > Thank you for your help. > > Mr. 427 > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor