为什么不通过
为什么不通过?
s = set(['Adam', 'Lisa', 'Paul']) L = ['Adam', 'Lisa', 'Bart', 'Paul'] for name in L: if name in s: s.remoce(name) else: s.add(name) print s
运行失败
Traceback (most recent call last):
File "index.py", line 5, in <module>
s.remoce(name)
AttributeError: 'set' object has no attribute 'remoce'