擅长:python、mysql、java
<p>您可以使用<code>in</code>找出某个键是否在字典中:</p>
<pre><code>if find in things:
print things[find]
</code></pre>
<p>或者只使用<a href="https://docs.python.org/2/library/stdtypes.html#dict.get" rel="nofollow">^{<cd2>}</a>返回与键关联的值或<code>None</code>:</p>
<pre><code>print things.get(find)
</code></pre>