title: How do I fix the error "unhashable type: 'list'" when trying to make a dictionary of lists?
body: <p>I'm trying to make a dictionary of lists. The input I am using looks like this:</p>
  
  <pre><code>4
  1: 25
  2: 20 25 28
  3: 27 32 37
  4: 22
  </code></pre>
  
  <p>Where 4 is the amount of lines that will be outputted in that format. The first thing I did was remove the "#: " format and simply kept each line like so:</p>
  
  <pre><code>['25']
  ['20','25','28']
  ['27','32','37']
  ['22']
  </code></pre>
  
  <p>So finally the goal was to take those values and put them into a dictionary with their assigned value in the dictionary being the length of how many numbers they held.</p>
  
  <p>So I wanted the dictionary to look like this:</p>
  
  <pre><code>['25'] : 1
  ['20','25','28'] : 3
  ['27','32','37'] : 3
  ['22'] : 1
  </code></pre>
  
  <p>However, when I tried to code the program, I got the error:</p>
  
  <pre><code>TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>def findPairs(people):
      pairs = {}
      for person in range(people):
          data = raw_input()
  
          #Remove the "#: " in each line and format numbers into ['1','2','3']
          data = (data[len(str(person))+2:]).split()
          options = len(data)
  
          pairs.update({data:options})
  
      print(pairs)
  findPairs(input())
  </code></pre>
  
  <p>Does anyone know how I can fix this and create my dictionary?</p>