请问,这样子为什么不行?
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul'] for a in s: for b in L: if a==b: s.remove(a) else: s.add(b) print s
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul'] for a in s: for b in L: if a==b: s.remove(a) else: s.add(b) print s
2015-09-05
举报