擅长:python、mysql、java
<p>使用<code>isinstance</code></p>
<p><strong>Ex:</strong></p>
<pre><code>j = [
{
"style": 7,
"accessDate": "2017-06-16T12:52:18Z",
"name": "Starbucks",
"location": {
"latitude": 40.767372,
"longitude": -111.891367,
},
"abstract": {
"type": 5
}
}
]
for i in j:
for key, value in i.items():
if isinstance(value, dict):
print(key)
</code></pre>
<p><strong>输出:</strong></p>
<pre><code>location
abstract
</code></pre>