title: How to loop through dictionary list and extract one key with boolean value
body: <p>I'm working on twitter data collected using Streaming API and was trying to remove all retweeted tweets. 
  A single item in my dataset looks like this:</p>
  
  <pre><code>tweets_data[5]
  
  {'contributors': None,
   'coordinates': None,
   'created_at': 'Thu Mar 09 15:14:10 +0000 2017',
  ... ...
   'retweet_count': 0,
   'retweeted': False,
  ... ...}
  </code></pre>
  
  <p>And I wrote a loop to do the job:</p>
  
  <pre><code>tweets_Rt_Removed = []
  for tweet in tweets_data:
      if tweet['retweeted'] == True:
          tweets_Rt_removed.append(tweet)
  
  print(len(tweets_Rt_Removed))
  </code></pre>
  
  <p>But it gave me an error like this:</p>
  
  <pre><code>KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-32-d44896eca6fd&gt; in &lt;module&gt;()
        4 
        5 for tweet in tweets_data:
  ----&gt; 6     if tweet['retweeted'] == True:
        7         tweets_Rt_removed.append(tweet)
        8 
  
  KeyError: 'retweeted'
  </code></pre>
  
  <p>I also use "try except" to avoid any error caused by incomplete tweets, but it return the length 0. </p>
  
  <p>Is this an error caused by boolean value?
  Any help appreciated!</p>