python中实现列表中指定元素保留唯一
>>> test1 = ["ccc","aaa","aaa","ccc","bbb","aaa","ddd","aaa"]
>>> test1.count("aaa")
4
>>> for i in range(test1.count("aaa")-1):
test1.remove("aaa")
>>> test1
['ccc', 'ccc', 'bbb', 'ddd', 'aaa']
>>> test1.count("aaa")
1