给定两个 list,A 和 B,找出相同元素和不同元素

#A、B 中相同元素:
print(set(A)&set(B)) 
#A、B 中不同元素:
print(set(A)^set(B))

猜你喜欢

转载自blog.csdn.net/Da___Vinci/article/details/92806530