Python: how can I check if the key of an dictionary exists?
<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>Let's say I have an associative array like so: <code>{'key1': 22, 'key2': 42}</code>.</p>

<p>How can I check if <code>key1</code> exists in the dictionary?</p>
