list01 = [1, 2, 3, 11, 12, 13] list02 = [1, 4, 10, 13, 17, 30] print('list对比相同元素为: {v}'.format(v=set(list01)&set(list02))) print('list对比不相同元素为: {v}'.format(v=set(list01)^set(list02)))
list01 = [1, 2, 3, 11, 12, 13] list02 = [1, 4, 10, 13, 17, 30] print('list对比相同元素为: {v}'.format(v=set(list01)&set(list02))) print('list对比不相同元素为: {v}'.format(v=set(list01)^set(list02)))