<div>Hi All,</div>
<div>I&#39;m beginning to learn Python for linguistic research using the Natural Language Toolkit. I want to write a small piece of code to count lengths of words and print them a long with the words. I&#39;ve tried this but it does not work. What&#39;s wrong with it, and how can I fix it?
</div>
<div>&nbsp;</div>
<div>
<p><font style="BACKGROUND-COLOR: #ffcc33">phrase2 = [&#39;colorless&#39;, &#39;green&#39;, &#39;ideas&#39;, &#39;sleep&#39;, &#39;furiously&#39;]<br>lengths = {}<br>for word in phrase2:<br>&nbsp;&nbsp;&nbsp; lengths = lengths[word, len(word)]
</font></p>
<p><font style="BACKGROUND-COLOR: #ffcc33">print lengths<br></font></p>Thank you in anticipation<br clear="all"><br>-- <br>If everyone is thinking alike, then somebody isn&#39;t thinking.&quot; George S. Patton<br>-------------------------------------------------------
<br>Emad Soliman Nawfal<br>University of Arizona, Tucson<br><a href="http://emadnawfal.googlepages.com">http://emadnawfal.googlepages.com</a><br>-------------------------------------------------------- </div>