擅长:python、mysql、java
<p>试试这个:</p>
<pre><code>for key, inner_dict in dict_.items():
if inner_dict['type'] == 'plugh':
print(key)
</code></pre>
<p>或者,如果使用一行程序来获取与条件匹配的第一个密钥:</p>
<pre><code>key = next(key for key, inner_dict in dict_.items() if inner_dict['type'] == 'plugh')
print(key)
</code></pre>
<p>输出:</p>
<pre><code>baz
</code></pre>