At the start of each run, the program picks a random integer between 1 and 100. Your goal is to guess it using the “too high” or “too low” feedback after each attempt. There is no guess limit — play continues until you find the number.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/muhammadalamzeb/python_projects/llms.txt
Use this file to discover all available pages before exploring further.
How to run
Gameplay
Start the game
Run the script. A random number between 1 and 100 is chosen immediately and kept secret.
Enter a guess
Type an integer at the prompt. The valid guessing range is strictly between 1 and 100 — the game rejects values of exactly 1 or 100 and anything outside that range with the message
"Please enter a number between 1 and 100".Terminal session example
Entering a non-numeric value (e.g.,
hello) prints "Value error!" but the game continues — you can keep guessing without restarting.Tips for winning efficiently
The fastest strategy is a binary search: always guess the midpoint of the remaining range.- Start with
50(midpoint of 1–100). - If “Too low”, your next guess is
75(midpoint of 51–100). - If “Too high”, your next guess is
25(midpoint of 1–49). - Keep halving the range after each clue.