不缩进不能运算
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
2019-11-17
举报