必须写 if not flag: 吗?不写也能运行啊
s1 = set([1, 2, 3, 4, 6, 8, 10])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
flag = s1.isdisjoint(s2)
for item in s1:
if item not in s2:
continue
print(item)
s1 = set([1, 2, 3, 4, 6, 8, 10])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
flag = s1.isdisjoint(s2)
for item in s1:
if item not in s2:
continue
print(item)
2023-02-21
举报