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

Method next_guess

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

Source from the content-addressed store, hash-verified

111
112 print("Example 5")
113 def next_guess(self):
114 if self.secret is not None:
115 return self.secret
116
117 while True:
118 guess = random.randint(self.lower, self.upper)
119 if guess not in self.guesses:
120 return guess
121
122 def send_number(self):
123 guess = self.next_guess()

Callers 1

send_numberMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected