CJCoding With Joseph
15free / daySign inCreate account

Higher Or Lower With Attempts

The secret number is 57, declared at the top (no random numbers). Inside a while True loop read a guess with the prompt Guess: as an int and count it in attempts. A guess equal to the secret prints Correct! and then Guesses: <n> on the next line and leaves the loop; a lower guess prints Higher!; a higher guess prints Lower!. Input: one whole number per line; the last line is 57. The prompt is part of the output, so each message follows its prompt on the same line.

Expected Output:

Guess: Higher!
Guess: Lower!
Guess: Correct!
Guesses: 3

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Menus & Validation
📥 Auto-Input:
50\n60\n57\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.