title: 'dict_keys' object is not subscriptable
body: <p>I am learning <code>random</code> function on Python 3 with this example, getting an error as the post title. <code>'dict_keys' object is not subscriptable</code>. I am not sure where i did wrong with <code>dictionary</code>.</p>
  
  <pre><code>import random
  outcomes = {
          'heads':0, 
          'tails':0
          }
  
  sides = outcomes.keys()
  
  for i in range(100):
      outcomes[random.choice(sides)] += 1
  
  print("Heads:", outcomes['heads'])
  print("Tails:", outcomes['tails'])
  </code></pre>
  
  <p>Below is the error output</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-1-f58aad35f1b0&gt; in &lt;module&gt;
        8 
        9 for i in range(100):
  ---&gt; 10     outcomes[random.choice(sides)] += 1
       11 
       12 print('Heads:', outcomes['heads'])
  
  C:\ProgramData\Anaconda3\lib\random.py in choice(self, seq)
      260         except ValueError:
      261             raise IndexError('Cannot choose from an empty sequence') from None
  --&gt; 262         return seq[i]
      263 
      264     def shuffle(self, x, random=None):
  
  TypeError: 'dict_keys' object is not subscriptable
  </code></pre>