Python - value in list of dictionaries
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1580270/whats-the-best-way-to-search-for-a-python-dictionary-value-in-a-list-of-dictiona">What&#39;s the best way to search for a Python dictionary value in a list of dictionaries?</a>  </p>
</blockquote>



<p>I have a list of dictionaries in the form</p>

<pre><code>my_dict_list = []
my_dict_list.append({'text':'first value', 'value':'number 1'})
my_dict_list.append({'text':'second value', 'value':'number 2'})
my_dict_list.append({'text':'third value', 'value':'number 3'})
</code></pre>

<p>I also have another list in the form:</p>

<pre><code>results = ['number 1', 'number 4']
</code></pre>

<p>how can I loop through the list of <code>results</code> checking if the value is in <code>dict</code>, e.g.</p>

<pre><code>for r in results:
    if r in my_dict_list:
        print "ok"
</code></pre>
