哪里错了?
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
for y in s:
if x==y:
s.remove(x)
else:
s.add(x)
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
for y in s:
if x==y:
s.remove(x)
else:
s.add(x)
print s
2018-08-03
举报