两个未排序的数组比较其元素是否一致

a = ["a", "b", "c", "d"]

b = ["b", "1", "d"]

print set(a) ^ set(b)

结果为:set(['1', 'a', 'c'])

 

相关文章: