擅长:python、mysql、java
<p>您正在寻找<a href="http://en.wikipedia.org/wiki/Multiset" rel="nofollow">multisets</a>,这正是<a href="http://docs.python.org/2/library/collections.html#collections.Counter" rel="nofollow">^{<cd1>}</a>的用途:</p>
<pre><code>>>> from collections import Counter
>>> list((Counter(l2) - Counter(l1)).elements())
[3, 4, 5, 6]
</code></pre>