擅长:python、mysql、java
<p>您可以使用set,请查看此函数:</p>
<pre><code>def list_diff(list1, list2):
return (list(list(set(list1)-set(list2)) + list(set(list2)-set(list1))))
diff_values = list_diff(listOne, listTwo) # call to this function
</code></pre>
<p>python集:<a href="https://docs.python.org/2/library/sets.html" rel="nofollow noreferrer">https://docs.python.org/2/library/sets.html</a></p>