title: Python: Comparing dictionary key with string
body: <p>I'm trying to compare the key in a dictionary with a string in Python but I can't find any way of doing this. Let's say I have:</p>
  
  <pre><code>dict = {"a" : 1, "b" : 2}
  </code></pre>
  
  <p>And I want to compare the key of the first index in the dictionary (which is "a") with with a string. So something like:</p>
  
  <pre><code>if ´Dictionary key´ == "a":
      return True
  else:
      return False
  </code></pre>
  
  <p>Is there a way of doing this? Appreciate all the help I can get.</p>