更新时间:2022-03-09 06:20:55
您正在寻找所有子列表的集合交集,您应该用于集合操作的数据类型是集合:
You are looking for the set intersection of all the sublists, and the data type you should use for set operations is a set:
result = set(p[0])
for s in p[1:]:
result.intersection_update(s)
print result