本文實(shí)例講述了python刪除列表中重復(fù)記錄的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
1
2
3
4
|
def removeListDuplicates(seq): seen = set () seen_add = seen.add return [ x for x in seq if x not in seen and not seen_add(x) ] |
希望本文所述對大家的Python程序設(shè)計(jì)有所幫助。