title: NLTK python error: "TypeError: 'dict_keys' object is not subscriptable"
body: <p>I am following instructions for a class homework assignment and I am supposed to look up the top 200 most frequently used words in a text file. </p>
  
  <p>Here's the last part of the code:</p>
  
  <pre><code>fdist1 = FreqDist(NSmyText)
  vocab=fdist1.keys()
  vocab[:200]
  </code></pre>
  
  <p>But when I press enter after the vocab 200 line, it returns:</p>
  
  <pre><code> Traceback (most recent call last):
   File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: 'dict_keys' object is not subscriptable
  </code></pre>
  
  <p>Any suggestions on how to fix this so it can correctly return an answer?</p>