本人无这样写为什么会报错
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in s:
if i in L:
s.remove(i)
else :
s.add(i)
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in s:
if i in L:
s.remove(i)
else :
s.add(i)
print s
2017-04-14
举报