- def test1():
- a=[2,4,5,2,6,8,0,9,8,5]
- list_test=[]
- for i in a:
- if i not in list_test:
- list_test.append(i)
- def test2():
- a=[2,4,5,2,6,8,0,9,8,5]
- list_test=list(set(a))
- list_test.sort(key=a.index))
- #该片段来自于http://www.codesnippet.cn/detail/190620134141.html
来源: http://www.codesnippet.cn/detail/190620134141.html