擅长:python、mysql、java
<p>也许这可以得到它:</p>
<pre><code>a={'dog':['hungry','fun'],'cat':['ugly','old'],'fish':[1,2,'hungry',4]}
b={'raccoon':['ugly',1,3,], 'bird':[18,'hungry'],'cat':['orange','short']}
result = []
for b_key, b_value in b.iteritems():
for a_key, a_value in a.iteritems():
if not any(x in a_value for x in b_value):
result.append((a_key, b_key))
print(result)
[('dog', 'raccoon'), ('cat', 'bird'), ('fish', 'cat'), ('dog', 'cat'), ('cat', 'cat')]
</code></pre>