import random
secret_number = random.randint(1,5)
max_attemps=3
attemps = 0
while attemps < max_attemps:
    guess = int(input("guess the secert number (between 1 and 5): "))
    if guess == secret_number:
        print ("congratulations! you guessed the number correctly.")
        break
    else:
        print("wrong guess. try again!")
        attemps += 1 
        if attemps == max_attemps:
            print("sorry, you ran out of attemps. the secret number was {secert_number}.")
            