更新时间:2022-05-27 22:04:27
您正在查找所有子列表的集合交集,并且您应该用于集合操作的数据类型是一组:
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