编程语言
首页 > 编程语言> > python去重后保证顺序不变

python去重后保证顺序不变

作者:互联网

l1 = [174149,174183,174177,174171,174131,174087,174135,174181,174127,174145,174137,174111,174097,174185,174189,174145,174179,174163,174167,174095,174095,174105,174155,174159,174151,174169,174187,174175,174101,174173,174165,174103,174161,174121,174077,174141,174125,174861,174825,174855,174861,174855,174837,174845,174827,174813,174857,174807,174865,174839,174857,174865,174807,174799,174843,174841,174805,174815,174853,174871,174869,174821,174851,174835,174859,174801,174823,174863,174847,174873,174873,174849,174811]

l2 = list(set_l1)
l2.sort(key=l1.index)

print(l2)

 

标签:174095,174865,顺序,174861,python,重后,174807,l2,l1
来源: https://www.cnblogs.com/syw-home/p/14878228.html