主页
Python
Python - 连接集合
demo_set_intersection_true
运行 ❯
×
更改方向
保存代码
更改主题
set1 = {"apple", 1, "banana", 0, "cherry"} set2 = {False, "google", "microsoft", "apple", True} set3 = set1.intersection(set2) print(set3)
{False, True, 'apple'}