# Part 4 mini-project: Number Guessing Game -- finished version.
#
# Run with: python projects/03-number-guess/finished.py

import random

target = random.randint(1, 100)
attempts = 0

print("I am thinking of a number between 1 and 100.")

while True:
    attempts += 1
    print("Guess: ", end="")
    guess = int(input())

    if guess < target:
        print("Too low.")
    elif guess > target:
        print("Too high.")
    else:
        print(f"Correct! You got it in {attempts} attempts.")
        break
