title: In Python, why is a tuple hashable but not a list?
body: <p>Here below when I try to hash a list, it gives me an error but works with a tuple. Guess it has something to do with immutability. Can someone explain this in detail ?</p>
  
  <p>List</p>
  
  <pre><code> x = [1,2,3]
   y = {x: 9}
    Traceback (most recent call last):
     File "&lt;stdin&gt;", line 1, in &lt;module&gt;
   TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>Tuple</p>
  
  <pre><code>z = (5,6)
  y = {z: 89}
  print(y)
  {(5, 6): 89}
  </code></pre>