求问这样子为什么不行
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
x = 0
while x <= 3:
if L[x] in s == True:
s.remove(L[x])
else:
s.add(L[x])
x = x + 1
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
x = 0
while x <= 3:
if L[x] in s == True:
s.remove(L[x])
else:
s.add(L[x])
x = x + 1
print s
2019-09-24
举报