摘要: python零散的小知识点 1.使用heapq模块,获取列表中n个最大或最小的元素 import heapq scores = [51, 33, 64, 87, 91, 75, 15, 49, 33, 82] print(heapq.nlargest(3, scores)) # [91, 87, 8 阅读全文
posted @ 2022-03-04 09:12 小杨的冥想课 阅读(34) 评论(0) 推荐(0) 编辑