集合的异或运算

数组元组等集合进行异或运算之后,得到的结果可以达到去重。

例如:两个set合并去重

c={"a","b","d","d"}
d={"e","f","g","h","a"}
c^d
Out[53]: {'b', 'd', 'e', 'f', 'g', 'h'}

https://blog.csdn.net/yuxuan89814/article/details/112182136

原文地址:https://www.cnblogs.com/JFHS/p/14440107.html