title: Dictionary: Why is `in` faster than `.get()` while checking keys?
body: <p>I wanted to check if the key exists in the dictionary. So, the usual method is to use the method <code>.get()</code>:</p>
  
  <pre><code>if some_dic.get('some_key'):
      return 'Yeah!, Key found'
  </code></pre>
  
  <p>There is also another way:</p>
  
  <pre><code>if 'some_key' in some_dic:
      return 'Yeah!, Key found''
  </code></pre>
  
  <p>Now, the question is why is the second method is faster? What happens in internally, it won't traverses the dictionary like a list, which should be slower, of course as no hashing:</p>
  
  <pre><code>if element in some_list:
      return 'got it' 
  </code></pre>
  
  <p>Thanks :)</p>