摘要: from collections import MutableMapping class SortedDict(MutableMapping): def __init__(self): self.data = {} def __getitem__(self, key): return self.da 阅读全文
posted @ 2022-06-25 09:35 我在路上回头看 阅读(49) 评论(0) 推荐(0)
摘要: def populate_ranks(votes, ranks): names = list(votes.keys()) names.sort(key=votes.get, reverse=True) for i, name in enumerate(names, 1): ranks[name] = 阅读全文
posted @ 2022-06-25 09:23 我在路上回头看 阅读(35) 评论(0) 推荐(0)