列表去重,不打乱原来的顺序,列表打乱顺序,def test1():
列表去重,不打乱原来的顺序,列表打乱顺序,def test1():
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://byrx.net
评论关闭