这样有什么错
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for a in L:
while a in s:
s.remove(a)
s.add(a)
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for a in L:
while a in s:
s.remove(a)
s.add(a)
print s
2019-08-05
举报