Skip to main content

๐Ÿ’œโญ โ€” Boss: Guess-the-Number I

Taskโ€‹

  • Create a file named guess.py.
  • Pick a secret number between 1 and 100.
  • Loop: ask for a guess until they get it right.
  • After each guess, print: too high / too low.
  • When correct, print how many guesses it took.
  • (Optional) Add an attempt limit (like 10 tries).

Docs / Tutorialsโ€‹

Hintsโ€‹

  • Use: import random and random.randint(1, 100).
  • Use a while True loop, break when correct.
  • Keep a counter guesses += 1 each loop.