为什么我这样不行呢
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in L:
if i in s:
s.remove(i)
s.add(i)
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in L:
if i in s:
s.remove(i)
s.add(i)
print s
2019-10-30
举报