# -*- coding: gbk -*- def uniq(ls): lsCopy=[e for e in ls] for i in xrange(1,len(ls)): for j in xrange(i): if ls[j]!=ls[i]: pass else: lsCopy.remove(ls[i])#如果有removeAt(index)方法更好 return lsCopy if __name__=='__main__': ls=[1,2,3,4,5,6,7,8,9,7,2,3,6] p