๐Ÿ PyQuest๐Ÿ•ต๏ธ Game: Number Detective ยท ๐Ÿ” Step 2: One Guess, One Clue
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

Step 2: One Guess, One Clue ๐Ÿ”

The computer has a secret. Now let a detective take a shot at it. ๐Ÿ•ต๏ธ

There's one catch: input() always hands back text, and you can't compare text to a number. Wrap it in int() and it becomes a real number:

age = int(input("How old are you? "))
if age >= 13:
    print("Teenager!")

Once it's a number you can use < and > to give clues.

Your mission

  1. Keep the secret and keep the spy print (you'll delete it next step)
  2. Ask for a guess with guess = int(input("Guess my number (1-50): "))
  3. Use if / elif / else to print one of three clues:
    • guess is smaller than the secret โžœ "Too low!"
    • guess is bigger โžœ "Too high!"
    • otherwise โžœ they nailed it! ๐ŸŽ‰

Your code

Press โ–ถ Run to see what your code does!