s1和s2有重合,为什么if语句if s1.isdisjoint(s2)==a:输出是2呢
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
a="False"
if s1.isdisjoint(s2)==a:
print(1)
else:
print(2)
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
a="False"
if s1.isdisjoint(s2)==a:
print(1)
else:
print(2)
2022-02-10
举报