How to test if a dictionary contains a specific key?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1602934/what-is-a-good-way-to-test-if-a-key-exists-in-python-dictionary">What is a good way to test if a Key exists in Python Dictionary</a>  </p>
</blockquote>



<p>What's the cleanest way to test if a dictionary contains a key?</p>

<pre><code>x = {'a' : 1, 'b' : 2}
if (x.contains_key('a')):
    ....
</code></pre>
