MCPcopy
hub / github.com/qiwsir/StarterLearningPython / rating

Method rating

newcodes/answers/q72.py:37–43  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

35 return list(self)
36
37 def rating(self, key):
38 item = self[key], key
39 i = bisect_left(self._rating, item)
40 print(i)
41 if item == self._rating[i]:
42 return i
43 raise LookupError("item not found in rating")
44
45 def get_value_by_rating(self, rating):
46 return self._rating[rating][0]

Callers 3

__setitem__Method · 0.95
__delitem__Method · 0.95
q72.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected