摘要: 1.查找列表中出现频率最高的值 # 方法一 a = [1, 1, 2, 3, 4, 4, 4, 5, 5, 6] max(a, key = a.count) # 方法二 from collections import Counter cnt = Counter(a) print(cnt.most_c 阅读全文
posted @ 2021-08-02 10:34 做个笔记 阅读(49) 评论(0) 推荐(0) 编辑