python list 成员交集

b1=[1,2,3]
b2=[2,3,4]

正则表达式:
b3 = [i for i in b1 if i in b2]
 

自带集合函数set()

 b3=list(set(b1) & set(b2))
 

 列表中的列表,用到函数filter()

原文地址:https://www.cnblogs.com/lovemo1314/p/2406101.html