python 两个list 求交集,并集,差集
摘要:def diff(listA,listB): #求交集的两种方式 retA = [i for i in listA if i in listB] retB = list(set(listA).intersection(set(listB))) print "retA is: ",retA print
阅读全文
posted @ 2018-01-20 18:23
[](>
)
posted @ 2018-01-20 18:23
Powered by:
博客园
Copyright © 2025 逐风浪子
Powered by .NET 9.0 on Kubernetes