请问如下的代码哪里出现问题了
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for name in L:
if name in s:
s.remove(name)
else:
s.add(name)
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for name in L:
if name in s:
s.remove(name)
else:
s.add(name)
print s
2017-06-15
举报