Python入门6-10练习试了好多遍,找不出错误,为什么运行不对?
s = set(['Adam','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','Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul'] for x in L: if x in s: s.remove(x) else: s.add(x) print s
2016-05-25
举报