<br><br><div class="gmail_quote">On Fri, Sep 17, 2010 at 9:08 AM, M. 427 <span dir="ltr">&lt;<a href="mailto:427@free.fr">427@free.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
<br>
(I am very new to python)<br>
I built a dictionary d={} of lists similar to this :<br>
<br>
d = {<br>
&#39;a&#39;: [&#39;apricot&#39;, &#39;apple&#39;],<br>
&#39;b&#39;: [&#39;beach&#39;, &#39;bear&#39;, &#39;bottle&#39;],<br>
&#39;c&#39;: [&#39;cold&#39;, &#39;cook&#39;, &#39;coleslaw&#39;],<br>
&#39;d&#39;: [&#39;deep&#39;],<br>
&#39;e&#39;: [&#39;expression&#39;, &#39;elephant&#39;]<br>
}<br>
<br>
Now i want to go through this dictionary and remove all rows containing<br>
only one entry. How should I do that?<br>
<br></blockquote><div>You can loop through all the entries in d, and remove the entries that have length one.  Hope that isn&#39;t too much of a hint <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
Question 2 : where should I have found this answer myself? (apart from<br>
here)<br>
<br>
<br>
Thank you for your help.<br>
<br>
Mr. 427<br>
<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Joel Goldstick<br><br>