擅长:python、mysql、java
<pre><code>a = ['a1','b2','c3']
b = ['a1','b2','c3']
c = ['b2','a1','c3']
# if you care about order
a == b # True
a == c # False
# if you don't care about order
set(a) == set(b) # True
set(a) == set(c) # True
</code></pre>
<p>通过将<code>a</code>、<code>b</code>和<code>c</code>作为一个集合进行强制转换,可以删除重复项,并且顺序不计算在内。比较集也比比较列表快得多,效率也高得多。</p>