为什么这样不行?
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul'] for x in L if x in s: s.remove(x) else: s.add(x) print s
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul'] for x in L if x in s: s.remove(x) else: s.add(x) print s
2016-12-28
举报