1lst = [1,1,2,3,3,5,6]23temp = list(set(lst))#先将列表转化为集合去重,再将集合转成列表45print(temp)
思路其实就是先把ids变为[[], 1,4,3,...] ,然后在利用reduce的特性。reduce解释参看这里:http://docs.python.org/2/library/functions.html#reduce
思路其实就是先把ids变为[[], 1,4,3,...] ,然后在利用reduce的特性。reduce解释参看这里:http://docs.python.org/2/library/functions.html#reduce