python 删除一个list的重复项
不改变原list,用copy复制一个新的list
import copy
list1=[2,2,3,4,5,6,7,7,8,9,9,10,11,12,12,13,13,14,15,15]
listcopy=copy.copy(list1)
i=0
while i<len(listcopy)-1:
j=i+1
while j <len(listcopy):
if listcopy[i]==listcopy[j]:
del listcopy[j]
else:
j+=1
i+=1
print(listcopy)