0
点赞
收藏
分享

微信扫一扫

python 数组取交集和差集


# 交集
print(set(newList).intersection(set(oldlist)))
# 差集
print(list(set(newList).difference(set(oldlist))))

 

举报

相关推荐

0 条评论