美文网首页
python 去重

python 去重

作者: 铁甲依然在人间 | 来源:发表于2021-09-14 11:43 被阅读0次
    list =[1,2,3,4,3,6,3]
    # #
    # def count1(x,list):
    #     list1= [ i for i in list if i ==x ]
    #     return len(list1)
    #
    # print(count1(3,list))
    
    def rep(list):
        temp=[]
        [temp.append(i) for i in list if i not in temp]
        return temp
    
    print(rep(list))
    

    相关文章

      网友评论

          本文标题:python 去重

          本文链接:https://www.haomeiwen.com/subject/lggewltx.html