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

Method rate

example_code/item_081.py:101–104  ·  view source on GitHub ↗
(self, rating)

Source from the content-addressed store, hash-verified

99 self.ratings = []
100
101 def rate(self, rating):
102 if not (0 < rating <= self.max_rating):
103 raise RatingError("Invalid rating")
104 self.ratings.append(rating)
105
106
107print("Example 6")

Callers 1

item_081.pyFile · 0.45

Calls 2

RatingErrorClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected