def guess_num() -> str:
    """
    049
    Create a variable called comp_num and set the value to 50. Ask the user to enter a number. While their guess
    is not the same as the comp_num value, tell them if their guess is too low or too high and ask them to have
    another guess. If they enter the same value as comp_num, display the message “Well done, you took [count] attempts”.
    """
    comp_num = 50
    guess = int(input("Entrer une chifre: "))
    attempts = 1
    while guess != comp_num:
        guess = int(input("Was your guess too high or too low? Enter another number: "))
        attempts += 1
    return f"Well done you took {attempts} attempts."