代码如下:
s= ["adam","xxx","lisa"]
L= ["adam","xxx","lisa","bart"]
for x in L:
print "this is ---%s" % xif x in s: print x L.remove(x)
print L
结果如下:
this is ---adam
adam
this is ---lisa
lisa
['xxx', 'bart']
[Finished in 0.2s]
为何'xxx'直接被无视了???
慕尼黑5688855
相关分类