if len(list) > 1:
list.sort()
last = list[-1]
for i in range(len(list)-2,-1,-1):
if last == list[i]:
del list[i]
else:
last=list[i]
list.sort()
last = list[-1]
for i in range(len(list)-2,-1,-1):
if last == list[i]:
del list[i]
else:
last=list[i]
리스트에 존재하는 중복되는 항목을 삭제
Python Grimoire 중에서...
Comment 달린것입니다.
tempDic = {}
if len( list ) > 1:
list.sort() for i in list:
tempDic[i] = ''
print tempDic.keys()
if len( list ) > 1:
list.sort() for i in list:
tempDic[i] = ''
print tempDic.keys()
Posted by gwlee

