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

Method next_guess

example_code/item_076.py:335–342  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

333
334 print("Example 20")
335 def next_guess(self):
336 if self.secret is not None:
337 return self.secret
338
339 while True:
340 guess = random.randint(self.lower, self.upper)
341 if guess not in self.guesses:
342 return guess
343
344 async def send_number(self): # Changed
345 guess = self.next_guess()

Callers 1

send_numberMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected