MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / populate_ranks

Function populate_ranks

example_code/item_025.py:93–97  ·  view source on GitHub ↗
(votes, ranks)

Source from the content-addressed store, hash-verified

91
92print("Example 10")
93def populate_ranks(votes, ranks):
94 names = list(votes.keys())
95 names.sort(key=votes.get, reverse=True)
96 for i, name in enumerate(names, 1):
97 ranks[name] = i
98
99
100print("Example 11")

Callers 1

item_025.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected