6. Adding Conditions
- Check if the guess is too high, too low, or correct, matching the conditional parts of our pseudocode.
IF guess is equal to target number
PRINT "Congratulations! You've guessed correctly."
PRINT guess count
EXIT loop
ELSE IF guess is less than target number
PRINT "Too low. Try again!"
ELSE
PRINT "Too high. Try again!"
if guess < target_number:
print("Too low. Try again!")
elif guess > target_number:
print("Too high. Try again!")
else:
print(f"Congratulations! You've guessed correctly in {guess_count} tries.")
break