python列表经典使用案例
1.判断list 内有无重复元素并去重判断有无重复元素In [27]: def is_duplicated(list_): ...: return len(list_) != len(set(list_))In [28]: list_ = [1,2,3,2,1]In [29]: is_duplicated(list_)Out[29]: True去重In [30]: def del_duplicated(list_): ...: return list(se
原创
2021-02-25 22:33:55 ·
1774 阅读 ·
0 评论