avoid mutating a list as you are iterating over it 代码: def remove_dups(L1,L2): for e in L1: if e in L2: L1.remove(e) L1=[1,2,4,5]L2=[2,3,1,6]remove_dups(L1,L2) L1 >[2, 4, 5] L2 >[2, 3, 1, 6] L1 is [2,4,5], not [4,5] why?Python uses an internal count…