Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ rate
Method
rate
example_code/item_081.py:125–127 ·
view source on GitHub ↗
(self, rating)
Source
from the content-addressed store, hash-verified
123
self.ratings = []
124
125
def
rate(self, rating):
126
assert 0 < rating <= self.max_rating, f
"Invalid {rating=}"
127
self.ratings.append(rating)
128
129
130
print(
"Example 8"
)
Callers
nothing calls this directly
Calls
1
append
Method · 0.45
Tested by
no test coverage detected