请问一下为什么如下代码不出结果?谢谢啦
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
if x in s:
s.remove(x)
else:
s.add(x)
print s
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
if x in s:
s.remove(x)
else:
s.add(x)
print s
2017-03-23
举报