【发布时间】:2020-03-26 11:45:08
【问题描述】:
我有一个列表,其中包含多个具有不同名称和字符串值的集合 {}。
例如。
set1 = {"a", "santa", "clock"}
search = {"why", "is", "santa", "nice"}
list_of_sets = [set1, search]
我想通过一个函数找到列表中集合之间的交集:
def intersection_between_sets_from_list(list_of_sets):
""" find the intersection between the sets here"""
return intersection_strings
知道在“”中使用什么代码在这里找到集合之间的交集“””。
【问题讨论】:
标签: python string set intersection