Hi Lina<br><br><div class="gmail_quote">On 17 November 2011 14:04, lina <span dir="ltr">&lt;<a href="mailto:lina.lastname@gmail.com">lina.lastname@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt;&gt; Traceback (most recent call last):<br>
&gt;&gt;  File &quot;&lt;pyshell#292&gt;&quot;, line 1, in &lt;module&gt;<br>
&gt;&gt;    weight[list1[0]]=1<br>
&gt;&gt; TypeError: unhashable type: &#39;list&#39;<br>
&gt;<br>
&gt; You are trying to store a list as a key inside a dict. This cannot be done<br>
&gt; because lists (like all mutable types) can&#39;t be hashed.<br>
<br>
</div>I checked online dictionary, still confused about hashed. is it equal<br>
to mix together or mess together?<br></blockquote><div><br></div></div>No.... you need to think programming/computer science where hash/hashing has a different meaning.  See wikipedia:<br><a href="http://en.wikipedia.org/wiki/Hash_function">http://en.wikipedia.org/wiki/Hash_function</a><br>
<a href="http://en.wikipedia.org/wiki/Hash_table">http://en.wikipedia.org/wiki/Hash_table</a><br><br>Also see the description for &quot;hashable&quot; in the Python glossary: <br><a href="http://docs.python.org/glossary.html#hashable">http://docs.python.org/glossary.html#hashable</a><br>
<br>Basically hashing is a way to convert something (often a string) into an identifying number (not neccesarily but usually unique) in order to use this number as a token for the original thing.  Aside, you can infer that that because the &quot;dict&quot; code complains about hashing implies that dicts themselves are essentially implemented as hash tables... ;) <br>
<br>HTH,<br><br>Walter<br><br><br>