1. 问题
你好,我是悦创。
我们先来阅读下面的代码:
def remove_all(L, x):
assert type(L) is list and x is not None
for i in L:
if i == x:
print(f"i: {i}-L: {L}")
L.remove(i)
else:
print(f"i: {i}-L: {L}")
# pass
return L
print(remove_all([9, 9, 1, 9, 8, 1], 9))