摘要: 转载自:Python中collections模块 目录 Python中collections模块 Counter defaultdict OrderedDict namedtuple deque ChainMap Python中collections模块 这个模块实现了特定目标的容器,以提供Pyth 阅读全文
posted @ 2019-11-28 17:21 +D 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 有一个txt文件,里面有许多单词,如图,要求输入一个单词,查询在文件里面出现了几次,并且根据给定的标准给单词“打分” scores = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2, "f": 4, "i": 1, "h": 4, "k": 5, " 阅读全文
posted @ 2019-11-28 17:01 +D 阅读(316) 评论(0) 推荐(0) 编辑