摘要: 1. 重复元素判定 以下方法可以检查给定列表是不是存在重复元素,它会使用 set() 函数来移除所有重复元素。 def all_unique(lst): return len(lst) == len(set(lst)) x = [1,1,2,2,3,2,3,4,5,6] y = [1,2,3,4,5 阅读全文
posted @ 2020-05-27 15:49 Liiu 阅读(177) 评论(0) 推荐(0) 编辑