为啥运行出来a是个空集
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
a=[]
if s1.isdisjoint(s2):
for x in s1:
for s in s2:
if s==x:
a.append(x)
print(a)
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
a=[]
if s1.isdisjoint(s2):
for x in s1:
for s in s2:
if s==x:
a.append(x)
print(a)
2022-12-06
举报