擅长:python、mysql、java
<p>使用<code>file1.symmetric_difference(file2)</code>获得一个新的集合,其中元素在<code>file1</code>或{<cd3>}中,但不能同时包含这两个元素。在</p>
<p>使用<a href="https://docs.python.org/2/library/sets.html#set-objects" rel="nofollow">set.symmetric_difference(t)</a>,可以传递任何iterable,这样就不需要创建第二个集合。在</p>