title: Does anyone know why I am receiving this error when trying to convert a list to a dictionary?
body: <pre class="lang-py prettyprint-override"><code>import re 
  from collections import Counter
  file = open(&quot;dialog.txt&quot;)
  
  fileContents = file.read().lower() 
  file.close()
  
  cleanupText = re.compile(&quot;[^a-zA-Z]&quot;)
  cleanText = re.sub(cleanupText,&quot; &quot;,fileContents)
  
  wordList = [cleanText.split()]
  
  wordDictionary = {}
  
  for item in wordList:
      if item in wordDictionary.keys():
          wordDictionary[item] += 1
      else:
          wordDictionary[item] = 1
  
  print(wordDictionary)
  </code></pre>
  <p>This is what I have so far which just returns unhashable type list error, I am trying to count the occurrences of each unique word in the list and display that in a dictionary.  Does anyone know the exact cause of this error in this context? What can I do to avoid this error?</p>