python 嵌套列表求交集

# # -*- coding: utf-8 -*-
# # @Time    : 2020/7/10 01:16
# # @Author  : wmy
'''
  嵌套列表求交集
'''
x1 = {(11, 27, 29), (61, 63, 64), (11, 24, 70)}
x2 = {(11, 24, 70), (17, 18, 21), (55, 59, 65)}
res = set(map(tuple, x1)).intersection(set(map(tuple, x2)))
print(res)

 

おすすめ

転載: blog.csdn.net/qq_36940806/article/details/107248903