麻烦大神看看为什么输出是不对
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in L:
s.add(i)
if len(s) == 3:
s.remove(i)
continue
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in L:
s.add(i)
if len(s) == 3:
s.remove(i)
continue
print s
2020-05-18
举报